Copy link to clipboard
Copied
HI all,
I've created a items dropdown menu in adobe form.
the name of a drop down list is "Header" which contains items as under,
2inch header
2.5inch header
3inch header
4 inch header
Now I have created a button named "3inch header". If i click on this button then the default value of "Header" dropdown changed to "3inch header"
how can i do this with javascript in adobe form?
pls help
In "PG" field value is "Pressure Gauge " and in your script it's "Pressure Gauge" whitout space at the end, you can just add space in your script to make it work.
Copy link to clipboard
Copied
You must reorder the items of the dropdown when you want change the default value.
The first entry in the list is the default value.
Copy link to clipboard
Copied
Hi there,
thanks for the prompt reply. But Can u elaborate a little and guide how can i do it ?
I am totaly new to this .
Thanks
Copy link to clipboard
Copied
Are you sure you want to change the default value, and not just the selected value?
Copy link to clipboard
Copied
no i want to change the selected value, not the default value. its my mistake.
I want to change value of drop down list every time i press the button
any help?
Copy link to clipboard
Copied
What do you mean by "every time I press button"? Do you want it to cycle through the values of the drop-down, or to apply a specific value when the button is clicked?
The latter is very simple:
this.getField("Header").value = "3inch header";
Copy link to clipboard
Copied
Thanks it works, actually i was doing spell mistake.. but now everything works fine.
Thanks once again 🙂
Copy link to clipboard
Copied
I've added below javascript lines in a button,
this.getField("Header").value = "Header Assembly (PP)";
this.getField("Filter 1").value="Screen Filter";
this.getField("Filter 2").value="Hydrocyclone Filter";
this.getField("Fertigation Unit").value="Ventury Injector";
this.getField("Bypass Valve-1").value="Butterfly Valve";
this.getField("Bypass Valve -2").value="PP Ball Valve FE";
this.getField("Bypass Tee").value="Bypass Tee (PP)";
this.getField("PG").value="Pressure Gauge";
this.getField("ARV").value="Air Release Valve";
this.getField("Text5.0.0").value="3Inch";
this.getField("Text5.1.0").value="3Inch";
this.getField("Text5.2.0").value="3Inch";
but it not works for all the fiedls, is there any restrictions of lines in javascripts?
I've also attached my pdf file for your reference. please take a look and reply
thanks
Copy link to clipboard
Copied
Where does it not work?
Copy link to clipboard
Copied
In "PG" field value is "Pressure Gauge " and in your script it's "Pressure Gauge" whitout space at the end, you can just add space in your script to make it work.
Copy link to clipboard
Copied
There is a limit to the length of a script, but you're nowhere near it...