haslo asi mejor:
Código PHP:
<script language="javascript">
function ValidarContacto(f) {
if (f.nombre.value == "") {
alert("Debe colocar su Nombre.");
f.nombre.focus();
return false;
}
if (f.apellidos.value == "") {
alert("Debe colocar su Apellido.");
f.apellidos.focus();
return false;
}
document.body.style.cursor = "wait";
return true;
}
</script>
Código:
<form name="fvalida" action="formulariovalida.php" method="post" onsubmit="return valida_envia(this)">
<input type="text" name="nombre" size="30" maxlength="50" />
<input type="text" name="apellidos" size="30" maxlength="50" />
<input type="submit" value=" Enviar ">
</form>
te falto colocar el tag "</form>"
saludos