Re: Javascript question

by Romek <zylla(at)>

 Date:  Thu, 13 Dec 2001 13:21:11 -0100
 To:  "cbirds(at)" <cbirds(at)>
 Cc:  hwg-techniques(at)
 In-Reply-To:  mediaone
  todo: View Thread, Original
At 16:13 12-12-01 -0500, you wrote:
>I am using this code in a javascript to alert people about fields not 
>filled in a form.

>Ones that work on regular fields look like this:
>if ( == "") {correct = false; alert("Please enter your 
>Ones that do not work that way nor this way on popup menus:
>if (document.state.value == "choosestate") {correct = false; 
>alert("Please select your state!")}

 The problem maybe is in the form itself (not seeing your code)
 I assume it is like the list with names of the sate and first
  position is value="choosestate"
  Then you have add  "selected" to this item to make your script
  code work.

  Eventually you can modify your "if" statement:

  if ( document.state.value == "choosestate"
       || document.state.value == "" )
     { correct = false;  alert("Please select your state!")}

  Mind the additional condition for checking if the field is empty

>It also doesn't work if you just have the first bar blank....and code 
>Any ideas?
Romek Zylla
~~~~~~~~~~~  after all the work done by Micro$oft (R)  ~~~~~~~~~~
        Personal Computer Science is an experimental one (C)

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