×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Denis Dotsenko
Added: May 24, 2017 1:49 PM
Views: 2361
Tags: ajax
  1.     $('#becomeSpeakerForm').submit(function() {
  2.         var valuesToSubmit = $(this).serialize();
  3.         $.ajax({
  4.             type: "POST",
  5.             url: $(this).attr('action'), //sumbits it to the given url of the form
  6.             data: valuesToSubmit,
  7.             success: function () {
  8.                 $('#modal2').arcticmodal('close');
  9.             }
  10.         });
  11.         return false; // prevents normal behaviour
  12.     });