Is it possible to allow both text and numbers but disallow special characters in this input field?
Currently, my code only allows numbers. How can I modify it to also allow text?
Is it possible to achieve this using JavaScript?
<form action=# name=f1 id=f1 onsubmit="return false">
<input type=text name=t1 id=t1 value="" size=25 style="width:300px;"
onkeypress="if(this.value.match(/\D/)) this.value=this.value.replace(/\D/g,'')"
onkeyup ="if(this.value.match(/\D/)) this.value=this.value.replace(/\D/g,'')"
>
</form>