Log in

View Full Version : Javascript radio button mandatory text validation


darryl333
Oct 11, 2008, 05:45 AM
Hello. Could you please help me with some javascript. In a section of my form, I want two radio buttons. When neither button is checked, an alert box will appear. If the first button is checked the form will pass. If the second button is checked, a series of mandatory text boxes are highlighted and must be validated before the form will pass.
Good luck and thanks
Darryl333

vingogly
Oct 11, 2008, 07:28 AM
The set and unset functions will let you manipulate your radio button functions dynamically:

Check Boxes and Radio Buttons (http://www.irt.org/articles/js027/index.htm)

And here's an example that illustrates how to show/hide a hidden form field when another is clicked:

Show/Hide form field selecting a radio button option | frinity (http://www.frinity.com/posts/css/show-hide-form-field-selecting-a-radio-button-option)