[Javascript] Re: newbie question
Cutter (javascript list)
javascript at theblades-family.com
Thu Nov 7 07:47:40 CST 2002
Good catch Mike. I never even saw the semicolon at the end of the condition
statement...
Cutter
Falcon Knives
Michael Ledig writes:
> Hello Cheryl,
>
> Cheryl Kirkpatrick schrieb:
> >
> ...
>
> > }
> > function verify() {
> > If (document.openp2.total.value != 'STAFF1FT');
> > alert ("Check your addition");
> > }
>
> The problem with your if-statement is the ";".
> If you place it at the end - after the condition - JavaScript finishes
> the if-statement and the alert-statement is always(!) executed.
>
> So you should write it this way:
>
> if (document.openp2.total.value != 'STAFF1FT')
> alert ("Check your addition");
>
> You should also take a look at the other hints - they can also help you
> ;-))
>
> HTH and greetings from Germany
> Mike.
>
> --
> Training und Projekte
> http://www.gidel.de
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript
More information about the Javascript
mailing list