Results 1 to 2 of 2

Thread: How can I use OnKeyPress?

  1. #1

    Thread Starter
    Hyperactive Member solar115's Avatar
    Join Date
    Apr 2002
    Location
    Thailand
    Posts
    268

    Question How can I use OnKeyPress?

    I want to check some keypress event on some text box (input box in form) by VBScript. How can I use it?
    ^solaris^

  2. #2
    Lively Member
    Join Date
    May 2001
    Location
    Fredericton, NB, Canada
    Posts
    85
    Code:
    <input type="text" name="strTextBox" onKeyPress="YOUR CODE HERE" />
    You really shouldn't be using VBScript for client side programming though...You should be using javascript as VBScript is compatible with IE only.

    With javascript you can determine the keypressed with the "keyCode" property of the event object...For example:

    Code:
    // if the user presses enter call the chkForm function
    if (event.keyCode == 13){
        chkForm();
    }

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