AND/OR in IF condition?

  • Is it possible to use a Logical AND or OR within an IF condition? Something like:

    Code
    onclick="if(
    	     			             	var1==value1 OR var1==value2 ,action(dothis)
    	     			             	else,action(dosomethingelse);
    	     			             	)
    	     			              	;
                           			"

    I tried, but I didn't succeed so far. If this is not possible, is there some workaround? What about using "case". How is the right syntax with that then?

    Thank you very much in advance.

    Michael

    Edited 2 times, last by mstoss (July 10, 2011 at 7:51 PM).

  • Well,

    A workaround only, still searching for the AND/OR solution:

    I have the feeling, that this is quite strange coding, but it is working at least. Would love to hear about a better solution *smile*

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!