Jump to content

[SOLVED] Field validation


mrsquash

Recommended Posts

Hello,

 

I have the following check that verifies whether or not a set of radio buttons are checked or not. This works great when neither of them are checked, but when one is checked it throws me this error: Error: 'document.inputForm.radio' is null or not an object

 

if (!document.inputForm.radio[0].checked && !document.inputForm.radio[1].checked) {

alert("Please make sure a radio button is checked.");

return;

}

Link to comment
https://forums.phpfreaks.com/topic/72529-solved-field-validation/
Share on other sites

I have "Yes" and "No" radio buttons with the same object name.  If neither button is checked I want it to display an error as you can see in my previous post.  And this part works fine.

 

BUT, as soon as one button is checked, it should continue processing the form, but instead I get the error message that you see in my previous post.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.