0

I have a Java form where I need to be able to switch a drop down with a text box using Javascript. The change would be made depending on the radio button choice the user makes. The drop down is the default form element and radio button A is checked by default. So when the user clicks radio button B the text box should appear and if they change their mind and select radio button A the drop down should come back.

Whats making this a little tricky is that I'm doing my form validation using Java via the form element name. So these two will have the same name. I need for the drop down to be switched off/disabled if they have radio button B and vice versa.

Is all this doable using javascript?

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by Thirusha
0

Yes this is doable using javascript, add an id parameter to the drop downs then on the javascript function call the id's, there are loads of examples to disable and enable an element on the internet to help u along as well. you can also look into using jquery, makes it much easier, no need to actually code anything just call the function.

0

Thanks Thirusha, will look into doing this using JQuery.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.