Se nella stringa <form name="loguser" action="../listenozze/accedi.php" method="post">
Sostituisco il tag name con id per renderlo compatibile con xhtml strict
Usando questo script:
<script type="text/javascript">
<!--
function contr()
{
torna=true;
if (document.loguser.username.value=="")
{
torna=false;
alert("Username obbligatorio!");
document.loguser.username.focus();
}
else
{
var user= new String(document.loguser.username.value);
user = user.toLowerCase();
document.loguser.username.value=user;
}
if (torna==true)
{
if (document.loguser.pswadm.value=="")
{
torna=false;
alert("Password obbligatoria!");
document.loguser.pswadm.focus();
}
else
{
var pass= new String(document.loguser.pswadm.value);
pass = pass.toLowerCase();
document.loguser.pswadm.value=pass;
}
}
if (torna==true)
{
document.loguser.submit();
}
return torna;
}
function contrl()
{
torna=true;
if (document.loguser.username.value=="")
{
torna=false;
alert("Username obbligatorio!");
document.loguser.username.focus();
}
else
{
var user= new String(document.loguser.username.value);
user = user.toLowerCase();
document.loguser.username.value=user;
}
if (torna==true)
{
if (document.loguser.pswadm.value=="")
{
torna=false;
alert("Password obbligatoria!");
document.loguser.pswadm.focus();
}
else
{
var pass= new String(document.loguser.pswadm.value);
pass = pass.toLowerCase();
document.loguser.pswadm.value=pass;
}
}
if (torna==true)
{
document.loguser.submit();
}
}
// -->
</script>
Cosi'facendo lo script non funziona piu', cosa devo modificare per fare in modo che funzioni con form id ???