coder81
01-09-2007, 12:17 PM
I have a form named "contacter" and a textarea named "Comments". I need to find a way to prevent quoatations from being placed in the textarea and if the area placed in the textarea; I want them to be automatically deleted.
I have tried to use:
onkeyup="this.value=this.value.replace('"','')"
and also...
onkeyup="this.value=this.value.replace(''','')"
But it will not work and I think the one single or double quotations marks cancels out the other one; when it is typed like this.
I have been looking around and seen a few pieces of script, but have not been able to get them to work.
I tried to create this; but it also did not work:
<script>
function check()
{
if (window.event.keyCode=222) {
document.contacter.Comments.value.length=-1;
return false;
}
else (void())
}
</script>
Any one know how I can get this textarea to automatically delete " and ' character, either onkeyup or onsubmit?
I have tried to use:
onkeyup="this.value=this.value.replace('"','')"
and also...
onkeyup="this.value=this.value.replace(''','')"
But it will not work and I think the one single or double quotations marks cancels out the other one; when it is typed like this.
I have been looking around and seen a few pieces of script, but have not been able to get them to work.
I tried to create this; but it also did not work:
<script>
function check()
{
if (window.event.keyCode=222) {
document.contacter.Comments.value.length=-1;
return false;
}
else (void())
}
</script>
Any one know how I can get this textarea to automatically delete " and ' character, either onkeyup or onsubmit?