5 var should_delete_testform
= true;
7 function handleSubmitFormEvent(e
) {
9 if (should_delete_testform
&& e
.currentTarget
) {
10 var form_element
= e
.currentTarget
;
11 form_element
.parentNode
.removeChild(form_element
);
13 history
.pushState({}, "", "password_push_state.html");
16 window
.onload = function() {
17 document
.getElementById("testform")
18 .addEventListener("submit", handleSubmitFormEvent
);
19 document
.getElementById("chg_testform")
20 .addEventListener("submit", handleSubmitFormEvent
);
21 document
.getElementById("mark_chg_testform")
22 .addEventListener("submit", handleSubmitFormEvent
);
28 <form action=
"password_push_state1.html" id=
"testform">
29 <input type=
"text" id=
"username_field" name=
"username_field">
30 <input type=
"password" id=
"password_field" name=
"password_field">
31 <input type=
"submit" id=
"submit_button" name=
"submit_button">
34 <!-- Change password form without the username explicitly marked. -->
35 <form action=
"password_push_state2.html" id=
"chg_testform">
36 <!-- No autocomplete=username. -->
37 <input type=
"text" id=
"chg_not_username_field" name=
"chg_not_username_field">
38 <input type=
"password" id=
"chg_password_field" name=
"chg_password_field"
39 autocomplete=
"current-password">
40 <input type=
"password" id=
"chg_new_password_1" name=
"chg_new_password_1"
41 autocomplete=
"new-password">
42 <input type=
"password" id=
"chg_new_password_2" name=
"chg_new_password_2"
43 autocomplete=
"new-password">
44 <input type=
"submit" id=
"chg_submit_button" name=
"chg_submit_button">
47 <!-- Change password form with the username explicitly marked. -->
48 <form action=
"password_push_state3.html" id=
"mark_chg_testform">
49 <input type=
"text" id=
"mark_chg_username_field" name=
"mark_chg_username_field"
50 autocomplete=
"username">
51 <input type=
"password" id=
"mark_chg_password_field"
52 name=
"mark_chg_password_field" autocomplete=
"current-password">
53 <input type=
"password" id=
"mark_chg_new_password_1"
54 name=
"mark_chg_new_password_1" autocomplete=
"new-password">
55 <input type=
"password" id=
"mark_chg_new_password_2"
56 name=
"mark_chg_new_password_2" autocomplete=
"new-password">
57 <input type=
"submit" id=
"mark_chg_submit_button"
58 name=
"mark_chg_submit_button">