form validation
- Started
- Last post
- 8 Responses
- ifThenGo
I am trying to validate a form with grouped checkboxes and am getting really frustrated.
Here is the Javascript i have so far.
http://beamlondon.com/PVN/form_v…
Everything validates perfectly apart from the checkboxes.
- cosmo0
which ones are the checked items?
- cosmo0
dummy, found it.
- cosmo0
hmmm...it looks like the right syntax.
- ifThenGo0
exactly. the weird thing is that if I change it to;
document.form.SA_sex.checked = false
then it gives me the error I want when I submit the form even though the check box is not selected :(
- cosmo0
shot in the dark, but try this.
document.form.SA_sex .checked != true
- ifThenGo0
I got all excited there because I thought it had worked.
It gave me the error as it should when no selection was made but then gave me the same error when I selected an option.
Grrrr...
- cosmo0
try that. I hate javascripts to be honest. Just hate them.
if (document.form.SA_sex.checked != true) {
missinginfo += "\n - What sex are you?";
}
else
{
//do watever here.
}
- ifThenGo0
thanks for the help cosmo. That code did the same thing though.
I'm going home. Approach it with a clear head tomorrow, been staring at this code for hours.
For the record I hate Javascript also, I've done this kind of thing in flash/actionscript and it was easy.
expect more requests tomorrow ;)