...

View Full Version : Validating radio buttons?



patrik
07-26-2002, 09: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!

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

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

http://www.codingforums.com/showthread.php?threadid=2510

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 ........
onsubmit="extra.required=true;
sample2.required=true;
return checkform(this)">

hope that helps, adios



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum