Copy link to clipboard
Copied
i work this javascript code menu :
var MyItems = new Array("1","2","3");
this.getField("Dropdown14.0").setItems(MyItems);
now i want a script help if user choose option "2" then count ++ field name BOX (1...2...3..4...5..............)
i try this but not working :
count=0
if (event.value=="2")
{
count ++;
}
So you want the number value in a text field to be incremented when the user selects "2" from the dropdown? Is this correct.
If it is then enter this Validation script into the dropdown
if(event.value == 2)
++this.getField("Box").value;
When you are driving events from a dropdown, then the code that performs the action should be in one of the dropdown scripts that is activated on a selection. The Validation script is a good choice.
Copy link to clipboard
Copied
So you want the number value in a text field to be incremented when the user selects "2" from the dropdown? Is this correct.
If it is then enter this Validation script into the dropdown
if(event.value == 2)
++this.getField("Box").value;
When you are driving events from a dropdown, then the code that performs the action should be in one of the dropdown scripts that is activated on a selection. The Validation script is a good choice.