Get data from form submission server code result

3 replies · opened Mar 4, 2021

QquantiumMar 4, 2021

Hi. When submitting a form I would like to get some info from the server code response.
My server code returns for example { “alert”: “success”, “message”: “Thanks for your request”, “requestid”: “32145” } and I want to get the requestid value, e.g. with formSubmitSuccess function with "data" parameter, something like:

jQuery(’#template-contactform’).on( ‘formSubmitSuccess’, function(data){ 
// Your JS Codes here 
var myrequestid=data.requestid; 
});

How can I do this?

SSemicolon WebSTAFFMar 5, 2021

Hello,

Thanks for your Patience!

Consider replacing your js/plugins.min.js File with the updated file attach to this reply.

Then simply use the following code:
[ch_pre]
jQuery('#template-contactform').on( 'formSubmitSuccess', function( event, data ) {
console.log( data );
});
[/ch_pre]

This will definitely work fine. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

QquantiumMar 5, 2021

Many thanks! I think that I gave you a nice idea! ;)

SSemicolon WebSTAFFMar 6, 2021

Hello,

Yes! :) It is a Brilliant Idea and opens new possibilities for Advanced Customization! Thank You so much!

Do let us know if we can help you with anything else.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard