Hi Friends.,

I have a validation code for an email and checkbox field on a form. The code check that all required fields (email and checkbox) are completed and when they are not showing the alert.

But when it is all completed, when you press the send button, it does not execute the action "mailer.php".

I leave the validation code here, maybe i have missed something and therefore do not run the action.

<script type="text/javascript">
function validar()
var email = document.getElementById('email');
var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value)) {
alert('Por favor compruebe la dirección de email');
return false;
	elemento = document.getElementById("checkbox");
if( !elemento.checked ) alert('Por favor acepte el aviso legal'); {
  return false;

	return true;

I really appreciate your help
Thanks a lot.