esiste uno script in grado di far inserire solo numeri nel campo di un form??
Una volta mi sembra di aver visto una cosa del genere, ma ora non saprei dove trovarlo...
esiste uno script in grado di far inserire solo numeri nel campo di un form??
Una volta mi sembra di aver visto una cosa del genere, ma ora non saprei dove trovarlo...
The gate to tomorrow is not the light of heaven but the darkness in the depth of the earth
Hai già postato in html!
No ai layout tabellari!
Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872
So ke non è permesso dal regolamento ma mi hanno consigliato di chiedere qui, altrimenti non avrei mai postato due volte lo stesso messaggio in due forum diversi!
The gate to tomorrow is not the light of heaven but the darkness in the depth of the earth
k, scusa!
No ai layout tabellari!
Insulto libero: http://forum.html.it/forum/showthread.php?s=&postid=12524872#post12524872
Up
The gate to tomorrow is not the light of heaven but the darkness in the depth of the earth
... così:
Da attivare così:codice:<script language="JavaScript"> function Controllo(myform) { var valore=myform.campo.value; if (isNaN(valore)) { alert("Inserire solo numeri!"); return false; } return true; } </script>
<form name="myform" onSumbit="return Controllo(this);">
Ciao !
Non so ma non funziona...Allora...ho messo lo script nel tag body xkè prima non mi è possibile (devo inserirlo in uno script php...) ecco cosa ho messo nel tag form:
<FORM name="myform" action="?act=configure" method="POST" onSumbit="return Controllo(this);">
The gate to tomorrow is not the light of heaven but the darkness in the depth of the earth
... così (non usando la funzione):
<FORM name="myform" action="?act=configure" method="POST" onSumbit="return (!(isNaN(this.nomecampo.value)));">
Fammi sapere !
Non funziona Ma questo script dovrebbe funzionare quando clicco sul pulsante submit o quando scrivo una lettera?? io vorrei uno script ke in certi campi del form non faccia proprio scrivere lettere o altri simboli ma solo numeri...sono sicuro di averlo visto...mi ricordassi dove...
The gate to tomorrow is not the light of heaven but the darkness in the depth of the earth
... un controllo in tempo reale ?
Prova così:
<input type="text" name="campo" onKeyUp="if (isNaN(this.value.charAt(this.value.length-1))) this.value=this.value.substr(0,this.value.length-1);">
Fammi sapere !