The Ajax submission form does not work on the first application url.icontact

advertisements

I need to send the form details to icontact page but its not going what to do

here is my code

 <script>
function submitForm() {
$.ajax({type:'POST', url: 'https://app.icontact.com/icp/signup.php', data:$('#ContactForm').serialize(), success: function(response) {
    $('#ContactForm').find('.form_result').html(response);
}});

return false;
}
</script>
<script>
function submitForm() {
$.ajax({type:'POST', url: 'zohoprocess.php', data:$('#ContactForm').serialize(), success: function(response) {
    $('#ContactForm').find('.form_result').html(response);
}});

return false;
}
</script>


You can use Asynchronous request like

function SubmitForm()
{
var formdata=$('#ContactForm').serialize();
$.ajax({
      type:'POST',
      url: 'https://app.icontact.com/icp/signup.php',
      data:formdata,
      success: function(response)
               {
               $('#ContactForm').find('.form_result').html(response);

               $.ajax({
                     type:'POST',
                     url: 'zohoprocess.php',
                     data:formdata,
                     success: function(response)
                             {
                             $('#ContactForm').find('.form_result').html(response);
                             }
                      });

               },
       error: function(xhr, textStatus, errorThrown)
               {
                  alert('request failed');
               }
      });
 }