cancel
Showing results for 
Search instead for 
Did you mean: 

Java Script Needed in Adobe Form

Former Member
0 Kudos

Hi,

I have one drop down box and two radio buttons, and the drop down contains two values for suppose "A" and "B". Now my requirement is when i choose the value "A" in drop down box automatically the first radio button should be selected and when user chooses second value"B" in drop down box then the second radio button should be selected. In which event should i write the java script and what to write. Any inputs will be greatly appreciated.

Regards,

Venkat

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

I am sorry now my requirement is slightly changed, by default the first radio button is selected. My requirement is when the user chooses the first value "A" or second value "B" from drop down box there should not be any radio button selected, all the radio buttons should be cleared and none of the radio button is selected. but when user clicks on send button, it should not proceed further until a radio button is selected, we need to get an error message saying that pelase select any one radio button. How to handle this error message and the java scripting for this scenario. Any help will be greatly appreciated.

Regards,

Venkat

harman_shahi
Contributor
0 Kudos

Hi Venkat,

You should write the following code in the "Change" event of the DropDown list. Make sure you choose 'Javascript' as your scripting language.


----- form1.#subform[0].DropDownList1::change - (JavaScript, client) ----------------------

var val = $.boundItem(xfa.event.newText);  //this will give you the selected DropDown list value.
RadioButtonList.rawValue = val;  //This will automatically select the specific radio button.

In this code: "RadioButtonList" is the name of the Radio Button Group. Make sure the values of the DropDownList Match the Values of your Radio Buttons.

Hope this helps,

Harman