Re: Javascript Logic - Brain Freeze

by "Srinivasan Ramakrishnan" <srinivar(at)md3.vsnl.net.in>

 Date:  Tue, 26 Sep 2000 03:23:25 +0530
 To:  <hwg-languages(at)hwg.org>,
<MEovino(at)Estes-Express.com>
 References:  express
  todo: View Thread, Original
At first glance the problem exists beause you are using a bitwise & and not
a &&.


-Srini
----- Original Message -----
From: <MEovino(at)Estes-Express.com>
To: <hwg-languages(at)hwg.org>
Sent: Monday, September 25, 2000 9:26 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