Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1623 How do I validate that the user has selected one of three radio buttons?

You are here: irt.org | FAQ | JavaScript | Form | Q1623 [ previous next ]

Try:

<script language="JavaScript"><!--
var oneSelected = false;
//--></script>

<form onSubmit="return oneSelected;">
<input name="r1" type="radio" onClick="oneSelected=true">
<input name="r1" type="radio" onClick="oneSelected=true">
<input name="r1" type="radio" onClick="oneSelected=true">
<input type="submit" value="Submit">
</form>

©2018 Martin Webb