Help to validate correctly: form with ajax
Hello friends. This form works to email. I need help: when validate display the div "this form has been sent correctly"
- $("#form1").submit(function(){
- if(validateUsername() & validatePassword1() & validatePassword2() & validateEmail())
- return true;
- else
- return false;
- });
- $(document).ready(function() {
- $(document).ajaxStart(function() {
- $('#loading').show();
- $('#result').hide();
- }).ajaxStop(function() {
- $('#loading').hide();
- $('#result').fadeIn('slow');
- });
- $('#form1').submit(function() {
- $.ajax({
- type: 'POST',
- url: $(this).attr('action'),
- data: $(this).serialize(),
- success: function(data) {
- $('#result').html(data);
- }
- })
-
- return false;
- });
-
- })
MIKEPIANIST