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="retur n
check_profilo_c ambia( this )">
<input type="text" name="nome" value="Mattia"> <br>
</form>
script:
function check_profilo_c ambia( myForm )
{
if( myForm.nome.val ue.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
--
Mattia
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="retur n
check_profilo_c ambia( this )">
<input type="text" name="nome" value="Mattia"> <br>
</form>
script:
function check_profilo_c ambia( myForm )
{
if( myForm.nome.val ue.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
--
Mattia
Comment