gcapp
04-27-2004, 05:01 PM
Can someone help me??
I have an asp form with 4 radio buttons and i want to have one button chosen before the form is submitted. I have this code snippet but if I do not check a button, the form still submits:
<head>
<SCRIPT language="JavaScript">
function Validate() {
if ((document.contest.Website.check == true) || (document.contest.Radio.checked == true) || (document.contest.Print.checked == true || (document.contest.Other.checked == true) {
return true;
}
else {
return false;
}
}
</script>
</head>
<form method="post" action="contest.asp" name="contest" onSubmit="return Validate()">
<input type="radio" value="1" name="Website>Website
<input type="radio" value="1" name="Radio">Radio
<input type="radio" value="1" name="Print">Print Ad
<input type="radio" value="1" name="Other">Other
How do I get the form to give a message stating that a button needs to be checked and to not submit if a button is not checked??
Any help would be appreciated.
I have an asp form with 4 radio buttons and i want to have one button chosen before the form is submitted. I have this code snippet but if I do not check a button, the form still submits:
<head>
<SCRIPT language="JavaScript">
function Validate() {
if ((document.contest.Website.check == true) || (document.contest.Radio.checked == true) || (document.contest.Print.checked == true || (document.contest.Other.checked == true) {
return true;
}
else {
return false;
}
}
</script>
</head>
<form method="post" action="contest.asp" name="contest" onSubmit="return Validate()">
<input type="radio" value="1" name="Website>Website
<input type="radio" value="1" name="Radio">Radio
<input type="radio" value="1" name="Print">Print Ad
<input type="radio" value="1" name="Other">Other
How do I get the form to give a message stating that a button needs to be checked and to not submit if a button is not checked??
Any help would be appreciated.