Results 1 to 3 of 3

Thread: Text box validation

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Location
    Minneapolis
    Posts
    42
    Hello,
    I think this is easy, but iam not able to figure it out.
    *****
    I have a "UserName" textbox on a html page.
    I wrote some javascript validation which checks if the user does not enter any data in the text box and alerts him with a message, before submitting the form.
    But if the user enters spaces(using SpaceBar on the key board), my javascript code is not able to handle that.

    Can any body please send me a sample javascript code to handle this case.
    *****
    Urgent please.
    Thanks,
    Srini

  2. #2
    hmmm
    is there no Trim() function in java, or maybe trying doing this,
    Code:
    if (left(username,1) == " ") { .......
    perhaps it might work.
    *urp*

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width