hello-someone was helping me with this several days ago but I still can't figure it out. This is what I am trying to do:
I have a form with several radio button type questions. Only one of the fields is required. If any of the not required fields are left blank when the user hits submit they will get an alert that says something like "Not all of the questions were answered, do you which to submit? Then the user picks Yes or No. If the user picks yes the form submits, if they pick No it doen not. I'm already using the onSubmit for another function (to validate the required field), can anyone help?
Here is part of the code:
function checkRequired( theForm )
{
var bMissing2 = false;
if ( 0 == theForm.Q15.value )
bMissing2 = true;
if (theForm.Q15.value.length!=6)
{
alert( "Please enter your six digit ID."
;
theForm.Q15.focus();
return false;
}
else
{
return true;
}
}
------THEN the Onsubmit:
onsubmit="return checkRequired(this)">
I have a form with several radio button type questions. Only one of the fields is required. If any of the not required fields are left blank when the user hits submit they will get an alert that says something like "Not all of the questions were answered, do you which to submit? Then the user picks Yes or No. If the user picks yes the form submits, if they pick No it doen not. I'm already using the onSubmit for another function (to validate the required field), can anyone help?
Here is part of the code:
function checkRequired( theForm )
{
var bMissing2 = false;
if ( 0 == theForm.Q15.value )
bMissing2 = true;
if (theForm.Q15.value.length!=6)
{
alert( "Please enter your six digit ID."
theForm.Q15.focus();
return false;
}
else
{
return true;
}
}
------THEN the Onsubmit:
onsubmit="return checkRequired(this)">