Expand my Community achievements bar.

2 javascript functions to populate 2 drop-down fields from separate arrays called by one change even

Avatar

Level 3

I have two javascript functions to populate two drop-down fields from separate arrays.

The calls to the javascript functions are from a change event from one preceeding field.

The problem I am having is that only the first javascipt function will run and populate the field from the array.

The second function does not execute.

Has anyone had this problem and also is there a solution or place to look towards debugging the source?

5 Replies

Avatar

Level 10

How does your script look like?

Avatar

Level 3
           <event activity="change" name="event__change">
              <script contentType="application/x-javascript">if (this.rawValue != xfa.event.change)

{

soScript.updateMarket(this.parent.Market , this.boundItem(xfa.event.change));

}

</script>

           </event>
           <event activity="change" name="event__change">
              <script contentType="application/x-javascript">if (this.rawValue != xfa.event.change)

{

soScript2.updateProjectType(this.parent.ProjectType , this.boundItem(xfa.event.change));

}

</script>

           </event>

Avatar

Level 3

I have fixed the problem, thank you for offering to help.

Avatar

Level 1

Hello Lucrecious/radzmar,

I have a similar situation. I am using XML data complaint to XFA format to inject the data. Below is my piece of code i see in the xfa document:

<

bind match="dataRef" ref="$.NoBranchActivity"></bind

>

<

event activity="change" name="event__change"

>

<

script contentType="application/x-javascript"

>

if ( Common.isCBOn(this) ) {

var totalBrCount = _Branch.count;

for (var i = totalBrCount - 1; i

&gt;

0; i--) {

_Branch.removeInstance(i);

}

BSACommon.disableAndResetFields(Branch);

Common.processFieldMakeNotRequired(Branch.BranchAddress2.State);

Common.processFieldMakeNotRequired(Branch.BranchAddress2.Country);

}

else {

Common.processFieldMakeRequired(Branch.BranchAddress2.Country);

Branch.BranchAddress2.State.clearItems();

StatesAndCountriesJS.initializeStates(Branch.BranchAddress2.State,false);

Common.enableFields(Branch);

BSACommon.setButtonsColor(Branch);

}

</

script

>

</

event

>

But when i populate this i use just the tags<noBranchActivity>X</noBranchActivity> and it checks the checkbox but doesnot trigger the click event. Can anyone help please?

Avatar

Level 1

Lucrecious,

How did you solve the issue? I am trying to get the click event(Checking a field will disable the rest of the fields in that group) working from my XML data set. And have no clue so far.