[Javascript] multiple ifs on one line syntax

Colin Cochrane colin at vfs.com
Thu Jun 6 09:50:42 CDT 2002


>if(form.TransType.options[form.TransType.selectedIndex].value == 'S') and
>(form.RecipientAgency.value=='P')   {
>...

You just have to remember that you're testing for a condition. In this
case, it's a condition with two criteria, but one condition nonetheless. So
you need to encapsulate the entire condition between outer parenthesis.(sp?)

ie:

if((form.TransType.options[form.TransType.selectedIndex].value == 'S') and
(form.RecipientAgency.value=='P'))   {


Hope this helps

cdc


Colin Cochrane
Head Instructor
Vancouver Film School New Media
http://www.vfs.com/
Tel: (604) 685-6331 Ext 209
Fax: (604) 685-6308

Vancouver Film School. Creative. Disciplined. Focused.





More information about the Javascript mailing list