View Single Post
  #2 (permalink)  
Old February 24th, 2006, 05:48 AM
ChrisScott ChrisScott is offline
Friend of Wrox
 
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Picco,

You could do something like this...
Code:
function fix_chars(textBox)
{
    textBox.value = textBox.value.replace(/['&_,%`"@~#]/g, "");
}
...
<input type="text" name="depapt" id="depapt" onKeyUp="fix_chars(this);" />
However, IMHO you should not rely on client side code to prevent db crashes as this can easily be disabled.

Also, these characters should not really be crashing your db.

HTH,

Chris

Reply With Quote