Hello! I've a Javascript function that has to verify if a form field is empty or not. My function works fine on my local server (Vertrigo), but when I upload it on server (online), the function doesn't verify if form fields are empty or not. Please help, I'm not good in Javascript. Thanks.
<head>
<script type="text/javascript" language="JavaScript">
function empty()
{if ( document.form.nume.value == '' )
{alert('ATENTIE! Introduceti numele!')
return false;}
if ( document.form.str1.value == '' )
{alert('ATENTIE! Introduceti strada!')
return false;}
if ( document.form.tel1.value == '' )
{alert('ATENTIE! Introduceti numarul de telefon pentru contact!')
return false;}
if ( document.form.loc1.value == '' )
{alert('ATENTIE! Introduceti localitatea!')
return false;}
if ( document.form.jud1.value == '' )
{alert('ATENTIE! Introduceti judetul!')
return false;}
return true;}
</script></head>
.... and function call...
<form action="contcomp.php" method="POST" name="form" onSubmit="return empty();">