Blur TextArea and Remove Chars

[Total: 0    Average: 0/5]

When the text area is blurred it will remove any newlines and double quotes.

Head Code:

<script>
function jsx1()
{
  var _f=document.my_form;
  var _o=_f.PASSCard_Message;
  var _r1= new RegExp("[nr]","g");
  _o.value=_o.value.replace(_r1,"  ");
  var _r2= new RegExp(""","g");
  _o.value=_o.value.replace(_r2,"'");
}
</script>

Body Code:

<form name=my_form>
<table>
<tr>
<td width="162" valign="top" height="62">This will remove &quot; and newlines when the user blurs the textarea [clicks away from it]
</td>
<td width="559" colspan="2" height="62">
<textarea onblur="jsx1()" rows="2" name="PASSCard_Message" cols="60"></textarea></td>
</tr>
</table>
</form>

Times Viewed: 5

Leave a Reply

Your email address will not be published. Required fields are marked *