RE: Javascript Form Problem

by "Charlton, Mark" <Mark.Charlton(at)saint-gobain.com>

 Date:  Thu, 22 Mar 2001 18:34:14 -0500
 To:  "'Sandy Fields'" <sandy(at)sannicron.com>,
hwg-languages(at)hwg.org
  todo: View Thread, Original
it depends on how many buttons you have and how they are set out, (grouped),
but I have used 

if (document.form.button.value == 'on' || document.form.otherbutton.value ==
'on') {
	// fine
} else {
	// Some error routine	
	alert('please complete form');
	return false;
}

and it seems to work.  Of the top of my head I can't think of the syntax for
group of radio buttons.

If the survey is important I would see if you could use a server side
language like ASP, perl or another to verify the completion as javascript
can be disabled in all browsers and is not active in others.  That then
depends on the server you are using as to which languages you have
available.  If you have microsoft IIS and want any help on an ASP validation
routine feel free to drop me a line.

Good luck
MC

-----Original Message-----
From: Sandy Fields [mailto:sandy(at)sannicron.com]
Sent: Thursday, March 22, 2001 5:46 PM
To: hwg-languages(at)hwg.org
Subject: Javascript Form Problem


I'm having to build a survey for work. I need a java script (or something) 
that will check to make sure a radio button has been checked for each 
section before the form will be accepted for submission (ie, script is tied 
to the submit button).

I've got the script for the text fields. Anyone know of one that works for
radio buttons?

all help greatly appreciated!

-- Sandy
Sannicron Web Design
http://www.sannicron.com

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

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.