Try to raise onChange event and "enter" key before submit form

This commit is contained in:
Grégory Soutadé 2017-07-08 08:42:34 +02:00
parent 65821a4e47
commit 7a7d2fd724

View File

@ -242,6 +242,16 @@ async function ask_server(form, field, logins, domain, wdomain, mkey, submit)
if (submit)
{
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();
}
else