View Full Version : Validating radio buttons?

07-26-2002, 08:31 PM
I hope this isn't a stupid question, but I have a form with a half dozen questions, each of which has 7 radio buttons for answers.

How can I flag a user who has forgotten to answer one of the questions?

I also have some text fields, but these will sometimes be legitimately left blank - don't know if that complicates things.

Thanks in advance for any help you can supply!

07-26-2002, 10:39 PM
uhhh.. could use an example. i bet it is possible but i'm not getting an image of what you want

07-27-2002, 01:34 AM
Not a stupid question; however, this question has been asked (and answered) several hundred times. See that 'search' link above?


Here's a modification to make certain (text) fields required:

function checkform(f) {
case 'text' :
case 'textarea' :
if (el.required && !el.value) {

...and (HTML):

<form ........
return checkform(this)">

hope that helps, adios