i'm trying to follow this tutorial guide on this website http://homepage.ntlworld.com/kayseycarvey/jss3p11.html?
However, i met some difficultly when doing so. Even though i did the exact same thing. Please guide me if you know so. Here are what i did:
<html>
<script>
function GetSelectedItem() {
chosen = ""
len = document.f1.r1.length
for (i = 0; i <len; i++) {
if (document.f1.r1[i].checked) {
chosen = document.f1.r1[i].value
}
}
if (chosen == "") {
alert("No Location Chosen")
}
else {
alert(chosen)
}
}
</script>
<body>
<form name="f1">
<Input type = radio Name = r1 Value = "NE">North East
<Input type = radio Name = r1 Value = "NW">North West
<Input type = radio Name = r1 Value = "SE">South East
<Input type = radio Name = r1 Value = "SW">South West
<Input type = radio Name = r1 Value = "midlands">Midlands
</form>
</body></script>
</html>
On a side note, do i have to do anything to the form in order to trigger the function GetSelectedItem ? Thanks in advance !