How can I disable character/numeric keys in text box

Discussion in 'HTML & Website Design' started by itsmemaneesh, Nov 26, 2006.

  1. #1
    How can I convert a textbox in to one which accept only character text or numeric text at a time ?



    For Eg:

    i)If I use the text box to Enter name it should only accept letters

    ii)If I use text box to enter Phone no or age, It should only accept numbers
     
    itsmemaneesh, Nov 26, 2006 IP
  2. Luke

    Luke Peon

    Messages:
    111
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Im not an expert but im under the impression you cant influence input that way.

    The only ways i can think might be possible is to get javascript to register the keystoke and then prevent non-alphanumeric characters.

    The second way, i would use it to process this after the page has been submitted "You cannot use anything but alphanumeric characters" and get them to resubmit or just omit the characters they used.
     
    Luke, Nov 27, 2006 IP
  3. kpwnd

    kpwnd Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can make a form that doenst allow any numbers to be SUBMITTED, but, they can still type it all they want.
     
    kpwnd, Nov 27, 2006 IP
  4. kpwnd

    kpwnd Peon

    Messages:
    108
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4

    That right there, will make you a box, and only allow numbers to be posted in there. Thats the best i can do for you.

    Jared
     
    kpwnd, Nov 27, 2006 IP