Refreshing page after filling out form

windows

Guest
I have a subscription form on my site. When someone fills out the form correctly they get sent to a "Thankyou" page and then returned automatically to the page they came from after 6 seconds using:<br />
<br />
"onload=setTimeout("location.href='http://www.htmlforums.com/archive/index.php/javascript:history.go(-1)'",6000)"<br />
<br />
The problem is that when they get sent back to the previous page the form fields still contain their email address and name. Is there some way to "Refresh" this page in the process so that the email and name are no longer there?<!--content-->yah don't go backwards. always go forward.<!--content-->But ... I want them to return to the page they came from. That would be backwards unless there is some way to scoop the page address and palce it in there on the fly but that is way to complex for such a simple thing I think. Has no one else ahd this problem. I get people clicking two or three times because they thibnk it hasn't worked even though they get to a "Thank you" page.<!--content-->I understand what you are saying, so read this<br />
<br />
<!-- m --><a class="postlink" href="http://www.htmlforums.com/showthread.php?s=&threadid=16779">http://www.htmlforums.com/showthread.ph ... adid=16779</a><!-- m --><!--content-->right after your closing form tag, put this:<br />
<br />
</form><br />
<script language=javascript><br />
document.formName.reset();<br />
</script><br />
<br />
<br />
<br />
and replace formName with the form name. <br />
<br />
Thats it. But scoutt is quite correct, you would pass in the page name along with the form, and then redirect FORWARD. better yet, you would just redirect them back to another cool page... no use keeping them on the form page when they are done.<!--content-->Originally posted by Dr. Web <br />
right after your closing form tag, put this:<br />
<br />
</form><br />
<script language=javascript><br />
document.formName.reset();<br />
</script><br />
<br />
and replace formName with the form name. <br />
<br />
Thats it. But scoutt is quite correct, you would pass in the page name along with the form, and then redirect FORWARD.<br />
<br />
I placed the script above where it should be but I still get the page coming back with the name and address still in the form fields. What am I doing wrong?<br />
<br />
Also how would I <br />
pass in the page name along with the form <br />
<br />
Is this also done with javascript in the same script as above?<!--content-->robert,<br />
<br />
did you change the formName to be your forms name?<br />
<br />
and the redirection I am talking about is done in your 'thank you' page. Do you have access to that page as well?<br />
<br />
if you can post your form page, and the action page, we can better help you.<!--content-->I changed "formname" in the example script to the real name of the form. I have attached the "Thank you" page and here is the form that sends the person to the "Thank You" page. This form is embedded in a page. I wasn't sure if I could attach two documents and the page this form is on is huge so I just sent you this.<br />
<br />
The form page is here: formpage (<!-- m --><a class="postlink" href="http://www.editfast.com/index.htm">http://www.editfast.com/index.htm</a><!-- m -->) (Go to the first form on the page)<br />
<br />
The "Thank You" page is here: Thank You (<!-- m --><a class="postlink" href="http://www.editfast.com/thanks/thanks.htm">http://www.editfast.com/thanks/thanks.htm</a><!-- m -->) <br />
<br />
<form name="lbaredit" style="display: inline" method="post" action="/cgi-bin/TFmail.pl"><br />
<input type="hidden" name="_config" value="editorial" /><br />
<span class="body11">Name:<br><br />
<input type=text name="realname" size="13" maxlength="25"><br />
<br><br />
E-mail:<br><br />
<input type="text" name="email" size="13" maxlength="35"><br />
<br><br />
</span> <br />
<input type="submit" class="submit" name="The_Editorial" value="GET IT!"><br />
<center><br />
<span class="body7">click here&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span> <br />
</center><br />
<span class="body11">Your e-mail address is never rented, traded or sold... <br />
period!</span> <br />
</form><br />
<script language=javascript> <br />
document.lbaredit.reset(); <br />
</script><!--content-->
 
Back
Top