Skip to content

Instantly share code, notes, and snippets.

@techslides
Last active June 14, 2016 19:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save techslides/cdc11e7211b26499df35364989f8d170 to your computer and use it in GitHub Desktop.
Save techslides/cdc11e7211b26499df35364989f8d170 to your computer and use it in GitHub Desktop.
Call a function after in-place edit loads a form
//change the formibdale.js file here: https://github.com/Strategy11/formidable-forms/blob/master/js/formidable.js#L3547
success:function(html){
$cont.children('.frm-loading-img').replaceWith(html);
$edit.removeClass('frm_inplace_edit').addClass('frm_cancel_edit');
$edit.html(cancel);
//ADD THIS: call some function if it is defined
if (typeof inlineEditCallback == 'function') {
inlineEditCallback();
}
}
//then define your function somehwere else (js file, template file, etc)
function inlineEditCallback(){
//perhaps load a script that is needed
$.getScript( "your-script.js", function( data, textStatus, jqxhr ) {
//your code based on your script and Fromidable Forms inline form being loaded
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment