Skip to content

Instantly share code, notes, and snippets.

@khangvm53
Created July 3, 2014 16:19
Show Gist options
  • Save khangvm53/cd3ef423f3428641079c to your computer and use it in GitHub Desktop.
Save khangvm53/cd3ef423f3428641079c to your computer and use it in GitHub Desktop.
Joomla.submitform = function(task, form) {
if (typeof (form) === 'undefined' || form === null) {
form = document.adminForm;
}
jQuery('.toolbox-saveConfig').trigger('click'); // dirty hack for megamenu save
if (typeof (task) !== 'undefined') {
form.task.value = task;
}
// Submit the form.
if (typeof form.onsubmit == 'function') {
form.onsubmit();
}
if (typeof form.fireEvent == "function") {
form.fireEvent('submit');
}
////build your data to save in here
form.submit();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment