Question : how do lI write an "or statement in javascript

Hi,
I'm trying to write a simple form validation with javascript. If the text box (promo) does not have "R10 or "r10" i need the alert to say "That is not the right promo code".
However, I dont know the right syntax . I have half of it, Can someone help me with the other half?
Thanks!
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
function checkEmpty(form, action) {
     if 		  (form.promo.value != "R10")	   
	  {
                        alert("That is not the right promo code.");
                   return false;
                  }	
}
Open in New Window Select All

Answer : how do lI write an "or statement in javascript

You could write it like this:

if((form.promo.value != "R10") || (form.promo.value != "r10"))

However, I would do case folding:

if(form.promo.value.toLowerCase() != "r10")
Random Solutions  
 
programming4us programming4us