Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 108516

Re: Form submission two buttons

$
0
0

Hi BCMan

 

Thank you very much. I do not really have code. I did but as it kept error I reverted back to form submit and one button. I just have a standard form and below is the ajax I just re mashed up. But not sure where to start with the file upload part even after looking at Mario's link.

 

function jqsub(btnID) {

var $f = $('formID'); // set your form ID

var $messagebox = $('#message.jobApp'); // set your message box ID

var $errormessage = "<h4 style='color:red'>There was a problem with your submission - Please Contact Us</h4>"; // replace with your own error

$messagebox.children('h4').fadeOut();

 

 

$.ajax({

  type: 'POST',

  url: $f.attr('action') + '&amp;JSON=1',

  data: $f.serialize(),

  success: function (msg) {

                        var formResponse = eval(msg);

                       

         if (formResponse.FormProcessV2Response.success) {

                        if(btnID === "submit") {

  window.location.href='the_link_to_go_to.html';

  }

  else {

  window.location.href='the_link_to_go_to.html';

  }

                        }

                        else {

                        $messagebox.append($errormessage)

                        $messagebox.fadeIn();

                        } 

                },

                 error: function (msg) {

                        $messagebox.append($errormessage)

                        $messagebox.fadeIn();

                        }

     });

}

 

I have 2 button and will pass the id to ajax to then direct user to specific page but the only reason I have not been able to get it to work is because of a file attachment. I Actually thought of just creating dummy buttons and the replacing pageID=url and then use .click to submit form. Both ways seem like workarounds. But what way is best?


Viewing all articles
Browse latest Browse all 108516

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>