Try to raise onChange event and "enter" key before submit form
This commit is contained in:
parent
65821a4e47
commit
7a7d2fd724
|
@ -242,6 +242,16 @@ async function ask_server(form, field, logins, domain, wdomain, mkey, submit)
|
||||||
if (submit)
|
if (submit)
|
||||||
{
|
{
|
||||||
form.removeEventListener("submit", on_sumbit, true);
|
form.removeEventListener("submit", on_sumbit, true);
|
||||||
|
// Propagate change
|
||||||
|
change_cb = field.onchange;
|
||||||
|
if (change_cb)
|
||||||
|
change_cb();
|
||||||
|
// Try to type "enter"
|
||||||
|
var evt = new KeyboardEvent("keydown");
|
||||||
|
delete evt.which;
|
||||||
|
evt.which = 13;
|
||||||
|
field.dispatchEvent(evt);
|
||||||
|
// Submit form
|
||||||
form.submit();
|
form.submit();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user