Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem Validating Data

Status
Not open for further replies.

ggrewe

IS-IT--Management
Jul 10, 2001
169
US
I am trying to validate a textbox field for a value that is not empty. I am using the following code. I added the code { alert(lcValue) ; } to test the value being passed. When the function fires, the alert "undefined" is displayed. Any help is greatly appreciated.

Code:
    <script language="javascript">
      function CheckValue(lcValue)
      {
      	{ alert(lcValue) ; }
      if (lcValue == " ")
         {
          return false
          }
      else
          {
          return true
          }
      }
    </SCRIPT>

...

    <tr><td align=right>Minister:<td><input type=text name=minister size=50 value=' ' onblur="return CheckValue(minister.Value)">



Greg Grewe
West Chester, Ohio
 
I think it should be value not Value.

Also use this.form.minister.value in your function parameter if it is in a form or use document.getElementById("minister").value by giving the textbox an id="minister".

Hope this was clear.

Regards
Satish
 
That was it, I had to pass the entire field name, all lowercase. Thanks for your help!



Greg Grewe
West Chester, Ohio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top