I want to create a loading code while the ajax call is not yet complete, AND enable my jquery code after calling the ajax of drupal form. The ajax I’m referring to is the “Add new field/Add more” of unlimited field. I don’t have a custom module for that. I’m just using what drupal already has.
This is the code that triggers the Ajax of the form:
$('input[name="field_collection_add_more"]').mousedown();
I can’t use the $(document).ajaxComplete(function(){}); nor ajaxStart
function of the jquery because I only want my functions to run on that specific ajax call for that specific field.
How can I use the beforeSend: and success: when the ajax add new field is running?
Thank you in advance for the help!