.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Home >> Code Snippets >> Javascript >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Javascript to allow the Required String

Posted By:Sasi Prabhu       Posted Date: April 14, 2012    Points: 40    Category: Javascript    URL: http://www.dotnetspark.com  

Client script to enter only the particular string in the textbox.

Step 1 :

Add a HTML textbox into your Page.

Step 2 :

Add this Javascript into your Page.
 unicode contains the currently pressed Character Code.
 String.fromCharCode(unicode) is used to get the Character currently pressed.
 Data contains the particular string in Array char format.
 Now get the textbox length and compare with the Data String.

Step 3 :
Run the Page.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend