View Single Post
Old 01-10-2013, 04:39 PM   PM User | #3
sunfighter
Senior Coder

 
Join Date: Jan 2011
Location: Missouri
Posts: 2,498
Thanks: 18
Thanked 362 Times in 361 Posts
sunfighter is on a distinguished road
Code:
<html>
<body>  DOES NOT BELONG HERE
<head>
<font face="Candara"> DOES NOT BELONG HERE AND IS DEPRECIATED

<title>Selection Validator</title>

<script type>="text/javascript" language="Javascript"> PLEASE CORRECT THIS IT IS TOTALLY WRONG
function validateChoice(genderForm)  {
genderOption = -1
for (i=0;   i<genderForm.genderChoice.length; i++)  {
if (genderForm.genderChoice[i].checked)  {
genderOption = i
alert ("You are a " + genderForm.genderChoice[i].value)
}
}
if (genderOption ==-1  { MISSING A CLOSING )
alert ("You must choose either Male or Female.")
return false
}
return true
}
</script>
</head>
</font> DOES NOT BELONG
</body>

<nonscript>
Javascript not detected! This page will not work properly.
</nonscript> REMOVE THIS IT DOES NOT WORK CORRECTLY

<form name ="myForm" onSubmit="return validateChoice(this)"> AS julien SAID, NEEDS AN METHOD  ALSO name ="myForm" S/B ID ="myForm" ALSO NEEDS AN ACTION

<p>Select your gender: &nbsp;

<input type="radio" name="genderChoice" value="Male" /> Male
<input type="radio" name="genderChoice" value="Male" /> Female value="Male" S/B value="female"
<input type="submit" value="Validate" />
</p>

</form>
</html>
Fix code and check again.

Last edited by sunfighter; 01-10-2013 at 04:47 PM..
sunfighter is online now   Reply With Quote