I get this when i run my code. I have no text inputs but I am seeing text inputs along with radio buttons when I run this.
<script>
function validateForm() {
var x = document.forms["myForm"][0].value;
if (x == null || x == "") {
alert("i must be checked");
return false;
}
var y = document.forms["myForm"][1].value;
if (y == null || y == "") {
alert("j must be checked");
return false;
}
var z = document.forms["myForm"][2].value;
if (z == null || z == "") {
alert("k must be checked");
return false;
}
}
</script>
<body>
<form name="myForm" onsubmit="return validateForm()">
<input type="radio" name="i">click<input/>
<input type="radio"name="j">click<input/>
<input type="radio"name="k">click<input/>
<input type="submit" value="submit">
</form>
</body>