You have to use the document object.
Code:
function checkForm(Form1){
if (!document.Form1.question[1].checked) {
var choice = confirm("Do you want to choose an answer?");
if (choice) {
return false;
}else {
myForm.action = "Quest1s.html";
}
}
}
Though, these days its better to use the getElementsByName() function. This will return an array of all the elements on the page which have the name set as the given value.
Code:
function checkForm(Form1){
if (!document.getElementsByName("question")[1].checked) {
var choice = confirm("Do you want to choose an answer?");
if (choice) {
return false;
}else {
myForm.action = "Quest1s.html";
}
}
}
Regards,
Andrew Buntine.
Bookmarks