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:
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:
// 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
$('li',$formId).removeClass('error');
$('span.error').remove();
// Validate all inputs with the class "required"
$('.required',$formId).each(function(){
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"
// Fade out error message when input field gains focus
$('.required').focus(function(){
var $parent = $(this).parent();
$parent.removeClass('error');
$('span.error',$parent).fadeOut();
});
});
</script>
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!
Bookmarks