I have problem using Internet Explorer. I have a form that has the last question about asking the user how they found us. It gives a dropdown list with various options with the last option being Other. If they select Other a box appears for them to Specify.
I'm using JavaScript to validate the form so it looks at the dropdown and if the value of the dropdown is "Other" it looks at the box to see if it's blank.
This works fine in Firefox, Safari, Google Chrome and Opera but in Internet Explorer 8 (it works in Version 9) when I click submit it complains about the "Please Specify" box being blank, even when I don't choose Other.
I thought JavaScript was reading the AND statement as OR but I think is must be something else.
Can anyone help/
Am I missing something here?
I'm using JavaScript to validate the form so it looks at the dropdown and if the value of the dropdown is "Other" it looks at the box to see if it's blank.
This works fine in Firefox, Safari, Google Chrome and Opera but in Internet Explorer 8 (it works in Version 9) when I click submit it complains about the "Please Specify" box being blank, even when I don't choose Other.
I thought JavaScript was reading the AND statement as OR but I think is must be something else.
Can anyone help/
Code:
function validate_form ( )
{
valid = true;
if ...
... else if (( document.quote_form.source.value == "Other" ) && ( document.quote_form.other.value == "" ))
{
alert ( "Please tell us how you found us." );
valid = false;
}
return valid;
}
Comment