Good evening I am not very advanced programming but I have a form with several fields, what I need is to validate that only numbers or letters are entered according to the field, but to clean the field where it failed after validating.
the fields are like this:
<input class="cajas" type="text" name="username" maxlength="10"
onblur="return validanumero(this.value)" required title="Solo
numeros">
and the validation is done by means of a function:
function validanumero(numero){
if (!/^([0-9])*$/.test(numero)){
alert("Ingrese solo numeros");
}
}
the form has several fields and they are in different php files.
I appreciate the help