Re: Validating Radio Button input if input is null

by "Data Driven Design" <datadriv(at)datadrivendesign.com>

 Date:  Fri, 21 Jun 2002 14:35:36 -0400
 To:  "Evans,
Chuck" <CEvans(at)Empirix.com>,
"HWG Languages (E-mail)" <hwg-languages(at)hwg.org>
 References:  empirix
  todo: View Thread, Original
Start with one button checked, then there's no possiblity of have one NOT
checked.

Regards,

Jeff Rossi

Data Driven Design
1506 Tuscaloosa Ave
Holly Hill, Florida 32117
http://www.datadrivendesign.com
----- Original Message -----
From: Evans, Chuck <CEvans(at)Empirix.com>
To: HWG Languages (E-mail) <hwg-languages(at)hwg.org>
Sent: Friday, June 21, 2002 1:58 PM
Subject: Validating Radio Button input if input is null


> I have a radio button pair, with neither preselected. I want to require
that
> the user choose one of the options. So, using Javascript validation, I
want
> to check to see if neither button has been selected. The two choices have
> values of "Customer" or "Prospect".
>
> But when I try using an if/then to look at the value of the button, I
can't
> come up with the null value. I've tried:
>
> if (document.MyForm.UserType.value == "") then...
>
> if (document.MyForm.UserType.value == null) then...
>
> if ( (document.MyForm.UserType.value != "Customer") &&
> (document.MyForm.UserType.value != "Prospect") ) then...
>
> Is there a short way to do this, or, as someone here suggested (without
> knowing the code) do I have to load all the possible values into an array
> and check for index (0)?
>
> Thanks for any help.
>
> Chuck Evans
> Web Marketing Manager
> Empirix Inc.
> phone 781.993.8675 | cell 508.259.6945 | fax 781.993.8779
> address 1430 Main Street | Waltham, MA | 02451
> web http://www.empirix.com
>
>
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA