mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 17:58:41 +00:00
enable data-action/data-method for non-form forms
This commit is contained in:
parent
dd974071d7
commit
549c46761e
|
|
@ -487,8 +487,21 @@ export class FormView {
|
|||
return;
|
||||
}
|
||||
|
||||
this.method = typeof e.attributes['method'] !== 'undefined' ? e.attributes['method'].value : 'EMPTY';
|
||||
this.action = typeof e.getAttribute('action') !== 'undefined' ? e.getAttribute('action') : 'EMPTY';
|
||||
if (typeof e.attributes['method'] !== 'undefined') {
|
||||
this.method = e.attributes['method'].value;
|
||||
} else if (typeof e.attributes['data-method'] !== 'undefined') {
|
||||
this.method = e.attributes['data-method'].value;
|
||||
} else {
|
||||
this.method = 'EMPTY';
|
||||
}
|
||||
|
||||
if (typeof e.attributes['action'] !== 'undefined') {
|
||||
this.action = e.attributes['action'].value;
|
||||
} else if (typeof e.attributes['data-action'] !== 'undefined') {
|
||||
this.action = e.attributes['data-action'].value;
|
||||
} else {
|
||||
this.action = 'EMPTY';
|
||||
}
|
||||
|
||||
const elements = this.getFormElements(),
|
||||
length = elements.length;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user