Re: Javascript Logic - Brain Freeze

by "Marko Schilde" <webmaster(at)planetdiablo.de>

 Date:  Mon, 25 Sep 2000 23:20:40 +0200
 To:  <hwg-languages(at)hwg.org>,
<MEovino(at)Estes-Express.com>
 References:  express
  todo: View Thread, Original
Isn't the logic AND operator represented by TWO ampersands in most
languages? [don't know about JavaScript, but you might want to check that
possibility]

-M
----- Original Message -----
From: <MEovino(at)Estes-Express.com>
To: <hwg-languages(at)hwg.org>
Sent: Monday, September 25, 2000 5:56 PM
Subject: Javascript Logic - Brain Freeze


>
> I know this should be obvious, but it's not to me.  In a validation
script,
> I want to make sure that one of two fields is filled.  The following is
> part of a much larger script.
>
> <snip>
> else if(document.forms[0].Class1.value == "" &
document.forms[0].Desc1.value == ""){
>      msg="Please enter a valid class or description";
>      msgflag="true";
>                 document.forms[0].Class1.focus()
>      }
> </snip>
>
> What this looks like, in my disordered mind, is that if the value of both
> fields is "", then do what's in the brackets.  Otherwise, move to the next
> statement.  However, if I leave either one blank, it shows the message
(msg
> is used in an alert box, shown when the msgflag is set to true).  What am
I
> doing wrong?
>
> Thanks in advance!
> Mike E.
>
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA