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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.