Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: How to verify if <CR> is typed in a text field


Message #1 by anguyen@f... on Thu, 22 Nov 2001 17:32:40
A CR is represented by a \r\n in JavaScript. Use Regular Expressions, or 
"ordinary" find methods like indexOf to search for the characters.

If you would like to trigger an event when somebody presses the "enter" 
button, use an event, like Key Pressed, and then lookup the keyCode for the 
event. The KeyCode for Enter  is 13.

Check out some JavaScript sites / faqs / books / search these archives for 
more information.

Imar


At 05:32 PM 11/22/2001 +0000, you wrote:
>Hello everyone.
>
>I have a Form with several text fields and a button.
>
>How can i verify if i press <CR> in one of the text field.
>is there any isCarriageControl function in Javascript or in VBscript to do
>this.
>
>Any help would be much appreciated.
>
>Thanks.



  Return to Index