code for checkbox
[html]
<form id="form1" name="form1">
<input type="text" id="email" name="email" />
<input type="checkbox" id="emailMe" name="emailMe" />
<input type="button" id="submit" name="submit" value="Submit" onclick="process();" />
</form>
[/html]
-
function process()
-
{
-
if(document.getElementById("emailMe").checked && document.getElementById("email").value == "")
-
{
-
//do something to tell the person to enter email
-
}
-
else
-
{
-
//do something when everything is ok
-
}
-
}
-
u'll have to make some changes to make it work with your code.
good luck
Works a TREAT thank you..
Only one more question....
The If Then Else statement, I want to get it to alert then stop the submit going ahead. I've got:
function process()
{
if(document.getElementById("emailMe").checked && document.getElementById("Job_TitleW").value == "")
{
alert("To process Email enrolment you MUST provide the Welsh Job title. Please add then Click Submit")
return false
//do something to tell the person to enter email
}
else
{
//do something when everything is ok
}
}
But this doesn't seem to stop the code running...