[thelist] JS alerts not working for input type=radio buttons

Sharon F. Malone sfmalo at 24caratdesign.com
Fri Feb 22 04:11:01 CST 2002


I have a number of alerts written for <.input type="text"> fields in a form, such as:
 if (theForm.which.value == "")
  {
    alert("Please enter a value for the \"which\" field.");
    theForm.which.focus();
    return (false);
  }
Then, I wrote alerts for two <.input type="radio"> fields in the same form, as follows:
 if (theForm.demo.value == "")
  {
    alert("Please enter a value for the \"demo\" field.");
    theForm.demo.focus();
    return (false);
  }

 if (theForm.manual.value == "")
  {
    alert("Please enter a value for the \"manual\" field.");
    theForm.manual.focus();
    return (false);
  }

  return (true);

Problem: The alerts work fine for the text inputs but don't work at all for the radio buttons.

Ideas as to what I'm overlooking here?

Best,
Sharon
---------------------------------------------------------------------------
Sharon F. Malone
"web design and Internet writing services"
http://www.24caratdesign.com
sfmalo at 24caratdesign.com




More information about the thelist mailing list