5 function navigate_and_submit() {
6 // First an in-page navigation, then submit.
7 window
.location
.href
= window
.location
.href
+ "#target";
8 document
.getElementById('testform').submit();
14 <a name=
"target">target
</a>
15 <form method=
"POST" action=
"done.html"
16 onsubmit=
"navigate_and_submit(); return true;"
18 <input type=
"text" id=
"username_field" name=
"username_field">
19 <input type=
"password" id=
"password_field" name=
"password_field">
20 <input type=
"submit" id=
"input_submit_button" name=
"submit_button">