JavaScript
--
Questions
--
Followers
Top Experts
Thanks.
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
onAfterSubmit="this.reset(
<BODY onload="self.opener.forms[
IMHO use gamer's solution
I was just giving another solution






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
you also can try somethings like this :
Test.html
==============
<Script language="Javascript">
<!--
function SubmitNClear()
{
window.open (""+ loc +"","NewWindow","top=0,lef
document.frmSubmit.Submit(
return true;
}
//-->
</Script>
<Form name="frmSubmit" action="Test.html" method="Post" onSubmit="javascript:Submi
...All your control
<input type="submit" name="submit" value="Submit">
</Form>
Regards
x_com
I much prefers Thirds suggestion
X_com: where does your script reset the form?
<form name="login">
<input type="hidden" name="server" value="server/exchange">
<font size="2"><b>Email</b></fon
<b>Username:</b><input type="text" name="username" size="15" tabindex="1"><br>
<b>Password:</b><input type="password" name="password" size="15" tabindex="1">
<input type=button value="Login" onClick="Login(this.form)"
</form>
I took out some of the formatting stuff to make it more readable.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
<input type=button value="Login" onClick="Login(this.form);






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
<script language="JavaScript" type="text/javascript">
function Login(f) {
var Out = 'WebMail.html'; // Name of the document you are submiting to
Out += "?server=" + f.server.value; // Build post-string
Out += "&username=" + f.username.value;
Out += "&password=" + f.password.value;
f.username.value = ''; // Reset form-field
f.password.value = ''; // Reset form-field
//f.reset(); // Could use f.reset() but it takes more time
var Win = window.open('','','HEIGHT=
Win.location = Out; // Open submit-document if new window
return (false); // Return 'event handled' (avoid double posting)
}
</script>
</head>
<body>
<form name="login">
<input type="hidden" name="server" value="server/exchange">
<font size="2"><b>Email</b></fon
<b>Username:</b><input type="text" name="username" size="15" tabindex="1"><br>
<b>Password:</b><input type="password" name="password" size="15" tabindex="1">
<input type=button value="Login" onClick="Login(this.form)"
</form>
</body>
<!-- Dummy WebMail-document shows the submited string-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head><title>WebMail</titl
<body><script>document.wri
</html>
You need to pass the value to the paramter in new window and the data wouldnt be retain afterward. You need to add Submit function and reload the same page after pass the value to the related parameters. My first comments is emphasize about Submit() function rather than using reset funtion. Your data is SUBMIT not to RESET. However, your submitted page will be reset afterward.
About the whole idea, i'm believe you can refer terjerosenlund's code.
Regards
x_com
should work just fine






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
JavaScript
--
Questions
--
Followers
Top Experts
JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.