I really need help, even I found a problem but I can't resolve it.

My goal was to use a fancy animated contact form using ajax and jquery, it worked but the problem appeared that if put the correct info into required fields, the submit (enviar) button doesn't react, I don't receive the email, here you can see in the 1 example:

http://portfolio.raulpinadesign.pt/contactos1.php (you can try filling the incorrect info and correct)

the contact form works, I receive a email if just from the input "submit" I delete the class "submit". But when my animation's don't work if I put the incorrect info, because this class is described in javascript. You can check in example 2:


I don't understand in which part javascript doesn't want to work with php... here is the code of 1 example:

java code that goes in the header:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

<script type="text/JavaScript">
$(document).ready(function() {


// Declare the function variables:
// Parent form, form URL, email regex and the error HTML
var $formId = $(this).parents('form');
var formAction = $formId.attr('action');
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var $error = $('<span class="error"></span>');

// Prepare the form for validation - remove previous errors

// Validate all inputs with the class "required"

var inputVal = $(this).val();
var $parentTag = $(this).parent();
if(inputVal == ''){
$parentTag.addClass('error').append($error.clone().text('Preencha por favor'));

// Run the email validation using the regex for those input items also having class "email"

if($(this).hasClass('email') == true){
$parentTag.addClass('error').append($error.clone().text('Preencha e-mail válido'));


// All validation complete - Check if any errors exist
// If has errors
if ($('span.error').length > 0) {


// Set the distance for the error animation
var distance = 5;

// Get the error dimensions
var width = $(this).outerWidth();

// Calculate starting position
var start = width + distance;

// Set the initial CSS
display: 'block',
opacity: 0,
right: -start+'px'
// Animate the error message
right: -width+'px',
opacity: 1
}, 'slow');

} else {
// Prevent form submission

// Fade out error message when input field gains focus
var $parent = $(this).parent();

contact form that goes in a body

<div id="formulario1">
<form id="form-sign-up" class="styled" action="mail-enviado.php" method="post">
<h2>Entre em contacto connosco</h2>
<li class="form-row"><label>Nome</label>
<input name="name" type="text" class="text-input required" />
<li class="form-row"><label>Empresa</label>
<input name="empresa" type="text" class="text-input required" />
<li class="form-row"><label>Email</label>
<input name="email" type="text" id="register-email" class="text-input required email" />
<li class="form-row"><label>Telefone</label>
<input name="telefone" type="text" class="text-input required" />
<li class="form-row"><label>Mensagem</label>
<textarea name="message" id="styled" /></textarea>
<li class="button-row">
<input type="submit" value="ENVIAR" name="submit" class="submit"/>

and php code that goes to the file mail-enviado.php

<div id="formulario1">

<div class="mensagem"><h2>MENSAGEM ENVIADO. OBRIGADO!</h2></div>

if(isset($_POST['submit'])) {
$to = "lina_balciunaite@yahoo.com";
$subject = "Trabalho";
$name_field = $_POST['name'];
$empresa_field = $_POST['empresa'];
$email_field = $_POST['email'];
$telefone_field = $_POST['telefone'];
$message = $_POST['message'];

$body = "Da: $name_field\n Empresa: $empresa_field\n E-mail: $email_field\n Telefone: $telefone_field\n Mensagem:\n $message";

mail($to, $subject, $body);

ofcause there is also stylesheet but I think here is not important Could smb tell me what is wrong, why javascript doesn't work together with php? THANK YOU VERY MUCH!