Skip to content

Commit bd8576e

Browse files
Merge pull request ZoneMinder#4444 from IgorA100/patch-990296
Fix: Pass the FORM to "submitThisForm" if the function is called not from the form itself, but from JavaScript code. (skin.js)
2 parents 2b879d9 + 0e4c499 commit bd8576e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

web/skins/classic/js/skin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,9 @@ function submitTab(evt) {
560560
function submitThisForm(param = null) {
561561
var form = this.form;
562562
var filter = null; // The filter that we previously moved to the left sidebar menu
563+
if (!form && param && typeof param === 'object' && ('tagName' in param && param.tagName == 'FORM')) { // A form can be passed as a parameter.
564+
form = param;
565+
}
563566
if (navbar_type == 'left' && !form) {
564567
if (currentView == 'console') {
565568
// We get the form that we process
@@ -1962,7 +1965,7 @@ function resetSelectElement(el) {
19621965
if (currentView == 'events') {
19631966
filterEvents(clickedElement = selectElement);
19641967
} else {
1965-
submitThisForm();
1968+
submitThisForm(this.closest('form'));
19661969
}
19671970
}
19681971

0 commit comments

Comments
 (0)