Currently without any javascript if a user does not select a radio button, it goes to a Coldfusion error page. Someone before me wrote the actual page and I, of course, needs to fix it. So i'm trying to add the following javascript and still goes to the cf error page. Any help would be great!
<script type="text/javascript">
function validate()
{
var a = document.getElementById('Abstract');
var b = document.getElementById('Book');
var c = document.getElementById('Paper');
var d = document.getElementById('Presentation');
var e = document.getElementById('Oral');
var f = document.getElementById('Journal');
var g = document.getElementById('Public');
var h = document.getElementById('Internal');
var i = document.getElementById('Good');
if ( (a.checked == false )
&& (b.checked == false )
&& (c.checked == false )
&& (d.checked == false )
&& (e.checked == false )
&& (f.checked == false )
&& (g.checked == false )
&& (h.checked == false )
&& (i.checked == false ) )
{
alert ( "Please Choose Document Type" );
document.frmSubscription.document.focus();
return false;
}
return true;
}
</script>
===
<cfform name="frmSubscription" onSubmit="return ValidateForm(); return validate();">
===
<input id="Abstract" type="radio" value="Abstract" name="document">
<input id="Book" type="radio" name="document" value="Book">
<input id="Paper" type="radio" value="Paper" name="document">
<input id="Presentation" type="radio" value="Presentation" name="document" >
<input id="Oral" type="radio" value="Oral Visual Presentation" name="document">
<input id="Journal" type="radio" name="document" value="Journal Article">
<input id="Public" type="radio" name="document" value="Public Web Site">
<input id="Internal" type="radio" value="Internal Web Site" name="document" >
<input id="Good" name="document" type="radio" value="Good Doc Report">