Hi
Firstly apologies for this question as I am sure it is really basic, however I just can't get my simple bit of code to do what I want.
I have a HTML form that I validate the entries with a bit of Java. All works perfectly until I try and check 2 fields using an AND operator (&&).
if (form.show.value =="Yes" && form.weeks.value == "elephant") { alert( "Please enter the number of weeks that the booking will run" ); form.weeks.focus(); return false ; }
It works if I use an OR operator (||) and works if I check either field singular. From the example I've seen on the net, the syntax looks ok...I've tried with brackets in different places, one & rather than &&, even tried a sub IF.
No point in pointing out that I'm very new to Java...
Many thanks in advance.
Chris


LinkBack URL
About LinkBacks
Reply With Quote

by clicking the
button on their useful posts.