M
Mattia
Hi!
I would like to validate a fiels in a form, but the code I wrote doesn't
seem to work:
HTML:
<form name="formNome" method="post" action="/index.php" onSubmit="return
check_profilo_cambia( this )">
<input type="text" name="nome" value="Mattia"><br>
</form>
script:
function check_profilo_cambia( myForm )
{
if( myForm.nome.value.length < 2 )
{
alert( "il nome deve essere composto da un minimo di 2 caratteri");
return false;
}
[...]
the js debugger keep saying that myForm.nome has no properties.
Thanks
I would like to validate a fiels in a form, but the code I wrote doesn't
seem to work:
HTML:
<form name="formNome" method="post" action="/index.php" onSubmit="return
check_profilo_cambia( this )">
<input type="text" name="nome" value="Mattia"><br>
</form>
script:
function check_profilo_cambia( myForm )
{
if( myForm.nome.value.length < 2 )
{
alert( "il nome deve essere composto da un minimo di 2 caratteri");
return false;
}
[...]
the js debugger keep saying that myForm.nome has no properties.
Thanks