Thread: HTML Validation
View Single Post
Old 24-05-07, 02:54 PM   #2 (permalink)
t_mohan
Moderator
 
t_mohan's Avatar
 
Join Date: Apr 2006
Location: India
Posts: 637
Thanks: 57
Thanked 84 Times in 68 Posts
Rep Power: 19 t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold t_mohan is a splendid one to behold
Re: HTML Validation

Hello Ganesh

Pls find the example given below, this doesnot accept the character < , > and / ,usually in the HTML we will be using these characters for tags,
Even if the user wants to type those character , he cannot enter these three characters. If you want , the text box not to accept more special character then write down a logical condition which specifies a range

Use this code given below, it works for you

< INPUT type="text" name="someText" size="10" maxlength="10" validate="true" onkeypress="if (event.keyCode == 60 || event.keyCode == 62 || event.keyCode == 47) event.returnValue = false;" >

Im not sure whether that should be == or =

Let me know your questions

Thank You
t_mohan is offline Offline   Reply With Quote