Ji guys, i’m trying to get the box that has been checked from customer with this script, but it gives me an “undefinite” string, is it because al the radios has the same name?
thx
//
<html>
<head>
<script type=”text/javascript”>
var selected
for (i=0; i<document.tv.station.length; i++){
if (document.tv.station[i].checked==true){
selected=i
}
}
</script>
</head>
<body>
<form name=”tv”>
NBC: <input type=”radio” name=”station”><br>
CBS: <input type=”radio” name=”station”><br>
ABC: <input type=”radio” name=”station”><br>
CNN: <input type=”radio” name=”station”><br>
ESPN:<input type=”radio” name=”station”><br>
<input type=”button” value=”selectedbox?” onClick=”alert(selected)” />
</form>
</body>
</html>