Form Removes Numbers

[Total: 0    Average: 0/5]

Use only alphabetical characters.

Body Code:

<script>
function lookAt(_form)
{
    var REG_EXP;
	    REG_EXP = /d/; /* matches any digit */
	    REG_EXP = /[a-z|A-Z]/; /* any character */
    _form.t2.value="";
    var _t1=_form.t1.value.split("");
	for(var i=0;i<_t1.length;i++)
	{
	  if(REG_EXP.test(_t1[i]) )
	  {
	    _form.t2.value+=_t1[i];
	  }
	}
}
</script>
<form name=f1>
<input type=text name=t1 value="" onchange="lookAt(document.f1)">
<input type=text name=t2 value="">
</form>

Times Viewed: 0

Leave a Reply

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