$.ajax refuses to work. Using jQuery Steps Plugin.
I'm using jQuery Steps plugin from jquery-steps.com. I have created a multi-step form and I want to submit it via AJAX. I'm inside WordPress environment and here's my code.
-----
- onFinished: function (event, currentIndex) {
- var form = $(this);
- alert("All Fine Till This Step");
- form.submit(function(event) {
- alert("Ajax Entry Successful");
- event.preventDefault();
- //$(".myspinner").show();
- var form = $(this);
- var io_resume_form_data = form.serialize();
- console.log();
- $.ajax({
- type:'POST',
- dataType:'json',
- url:ajaxurl,
- data:io_resume_form_data,
- success:function (data, textStatus) {
- alert("SUCCESS");
- },
- error:function (jqXHR, textStatus, errorThrown) {
- alert("FAIL");
- },
- complete: function(){
- //$(".myspinner").hide();
- }
- });
- });
- }
----
1. I get alert - "All Fine Till This Step", as expected upon clicking 'Finish' button on the form's last step.
2. Nothing happens I close above alert. It looks like AJAX ain't letting me in; and I've no clue why. My best guess is that I've messed up with the form.submit().
Would really appreciate if you could offer a helping hand. I've already spent almost a day trying to fix it all by myself. Thanks!