/    Sign up×
Community /Pin to ProfileBookmark

History:Back question

Hello,

I’m a newbie at this, so please be patient. I have a webpage where one can subscribe to an e-newsletter. After you subscribe, it takes you to a “thank you” page that gives a link for going back. Here’s the code:

<p><strong>You have successfully subscribed to this list.<br /><a href=”javascript:history.back()”>Click here</strong></a> to return to the site.</p>

Right now, when the user goes back to the webpage from the thank you page, the e-mail address originally entered is still there. How can I make the e-mail address disappear from the posting textfield.

Thanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991May 29.2008 — You will have to clear the field onbeforeunload of the original page. I think that the value will still be submitted, but I'm not absolutely certain. Something like this:[code=php]window.onbeforeunload = function(){
document.getElementsByName("TEXTBOXNAMEHERE")[0].value="";
}[/code]
Copy linkTweet thisAlerts:
@mstashauthorMay 29.2008 — Declan, thanks a lot. This worked perfectly!
×

Success!

Help @mstash spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...