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 with username. -->
35 <form action=
"password_push_state2.html" id=
"chg_testform">
36 <input type=
"text" id=
"chg_username_field" name=
"chg_not_username_field">
37 <input type=
"password" id=
"chg_password_field" name=
"chg_password_field">
38 <input type=
"password" id=
"chg_new_password_1" name=
"chg_new_password_1">
39 <input type=
"password" id=
"chg_new_password_2" name=
"chg_new_password_2">
40 <input type=
"submit" id=
"chg_submit_button" name=
"chg_submit_button">