Send data when form has been send successfully instead of on click

Hi Guys,

I’m not at all familiar with scripts or Gravity forms, but I’m trying to send form data to my CRM.

This code works fine, but it will send the data when I click the submit button,
jQuery(document).ready(initLanding);
$( “#gform_15” ).submit(function( event ) {
createObject();
});

So I tried this, by Googling and reading, but as I don’t understand the whole I guess it’s either a simple question/change or I’m totally looking in the wrong corner.

jQuery(document).ready(initLanding);
jQuery(document).on(‘gform_confirmation_loaded’, function(event, formId){
if(formId == 15) {
createObject();

I hope someone can point me in the right direction.

Thanks in advance.