Here is a solution that clones the existing save buttons container html element on insert and edit forms and inserts clones of that element before each separator. (Works in DaDaBIK version 11.12-Elba enterprise.)
Precondition: In the Form configurator, use "Add Separator before this field (insert form)" and "Add Separator before this field (edit form)" to add separators to your long form (you may have already done this).
Then add the following code to your
custom_functions.js:
JavaScript:
/* duplicates save_buttons_container and inserts a duplicate before each separator */
function duplicateAndInsertSaveButtons() {
var $firstElement = $('.save_buttons_container:has(*)').first(); // Find the first element with the save_buttons_container class that has children (there are some that don't in the insert form)
var $clonedElement = $firstElement.clone(); // Clone the found element
$('.form_separator').each(function(index) { // Iterate over each separator element
if (index > 0) { // Omit first element to avoid getting two save_buttons_container elements in direct succession on top of the edit form
$clonedElement.clone().insertBefore($(this)); // Clone the original clone and insert it before the current target element
}
});
}
$(document).ready(function() {
duplicateAndInsertSaveButtons();
});
Looks like this in the insert form (button colors have been customized):
Looks like this in the edit form (button colors have been customized):