I want to check some keypress event on some text box (input box in form) by VBScript. How can I use it?
Printable View
I want to check some keypress event on some text box (input box in form) by VBScript. How can I use it?
You really shouldn't be using VBScript for client side programming though...You should be using javascript as VBScript is compatible with IE only.Code:<input type="text" name="strTextBox" onKeyPress="YOUR CODE HERE" />
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();
}