di******@yahoo. com wrote:
I've a textbox field, where user enters his name. I want to restrict
him from entering double and singls inverted commas.What kind of
function should i write.
If you want to do this to prevent the input from breaking a server-side
script, then you mustn't use javascript. Validate the input on the
server side instead. Otherwise, people without javascript will still
enter the invalid characters and your server-side code will break.
If that's not the case, you can use something like this:
<input type="text" onkeyup="this.v alue=this.value .replace(/\'/g, '')" />
Jeremy