earwig75
asked on
Form validation question
I have a Div with a class called "ss-item-required". In that div I have some text boxes and radio buttons. I want to validate each set of radio buttons and input boxes. The radio button validation is working, but the text boxes are not validating. Below is the code I am using to check that the radio buttons are validated. Can someone help me add to this script so that any input boxes in the div with that name are also validated? Thank you.
if ($('div.ss-item-required:not(:has(:radio:checked))').length > 0) {
alert("Make a selection");
return false;
ASKER
This doesn't seem to work with a div class. Is it possible to just add to my existing validation? Basically a repeat of the line below checking for a checked radio button, but check that an input box in that DIV has content? I am not using labels or classes on the inputs.
Thanks again.
Thanks again.
if ($('div.ss-item-required:not(:has(:radio:checked))').length > 0) {
alert("Make a selection");
return false;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sample code below - full working source here
Open in new window