[Javascript] newbie question

Michael Ledig hobbes_tiger at gmx.de
Thu Nov 7 03:36:54 CST 2002


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





More information about the Javascript mailing list