Dronealone
IS-IT--Management
Hello,
I want to do some simple error checking with Javascript. I have a form which contains the following element:
<input type='radio' name='answer[5]' value='17'>
and I am using the following function called by the onsubmit event to check that the radio has been checked:
function checkform (form)
{
if (form.answer[5].value == ""
{
alert( "Please enter your first name." )
form.answer[5].focus();
return false;
}
return true;
}
However I constantly get an error answer.5 is null or not an object...
Can anybody help me here!!
Thanks.
I want to do some simple error checking with Javascript. I have a form which contains the following element:
<input type='radio' name='answer[5]' value='17'>
and I am using the following function called by the onsubmit event to check that the radio has been checked:
function checkform (form)
{
if (form.answer[5].value == ""
alert( "Please enter your first name." )
form.answer[5].focus();
return false;
}
return true;
}
However I constantly get an error answer.5 is null or not an object...
Can anybody help me here!!
Thanks.