Forum Moderators: open

Message Too Old, No Replies

Radio button validation, not working in Netscape

I need to make sure the user chooses one radio button before they proceed

         

amdorsey

4:05 pm on Feb 20, 2004 (gmt 0)

10+ Year Member



It works fine in IE, but not in Netscape.
Does anyone know why or have any other simple radio button validation that will work in both browsers?

Here is my Javascipt...

<script language="JavaScript">
<!--
function radio_checker()
{
// set var radio_choice to false
var radio_choice = false;

// Loop from zero to the one minus the number of radio button selections
for (counter = 0; counter < DesignOptions.design.length; counter++)
{
// If a radio button has been selected it will return true
// (If not it will return false)
if (DesignOptions.design[counter].checked)
radio_choice = true;
}

if (!radio_choice)
{
// If there were no selections made display an alert box
alert("Please select a Design before you Continue!")
return (false);
}
return (true);
}

-->
</script>

isitreal

6:17 pm on Feb 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You have your input buttons with all the same name, right?

<input type="radio" name="radDrinkSize" value="Small">
Small
<input type="radio" name="radDrinkSize" value="Medium">
Medium
<input type="radio" name="radDrinkSize" value="Large">
Large
<input type="radio" name="radDrinkSize" value="Colossal">
Colossal</p>