I am just wanting to check to see if either radio button is selected. Right now, if they select yes, then the errMessage doesn't display, which is want I want. However, if they select no, if will. I only want the errMessage if they don't select either yes or no. Any suggestions would be appericated.
Here's the basic code:
function doSubmit()
{
var errMessage=""
if (!document.applynow.cemp1.checked)
{
errMessage = errMessage + "\n - Please answer if employer 1 of Employment History is your current employer.";
}
if (document.applynow.emp1position.value=="")
{
errMessage = errMessage + "\n - Please enter your last position title of employer 1 of Employment History.";
}
if (errMessage != "")
{
errMessage = "The following filled need to be completed" + errMessage
alert(errMessage);
}
else{
document.applynow.submit();
}
}
-------
<form name="applynow" action="thankyou.asp" method="post">
Is this your current employer:
Yes: <input type="radio" name="cemp1" value="Yes" id='one' />
No: <input type="radio" name="cemp1" value="No" id='two' />
Job position(s): <input type="text" name="emp1position" size='40' />
<input name="cmdSubmit" type="button" value="Submit Application" onclick="doSubmit()" >
</form>