/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Cancel/Go Back function?

I’m wondering what the syntax for a simple Cancel command is (which will undo changes and go back to the previous page)? I have searched hi and low for it but have had no luck. Any help would be spectacular!

I was hoping to find something that would be along the lines of a simple submit(‘yes’, “); command, but like I said, I haven’t been able to find anything.

Thanks Again!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@mrhooFeb 25.2010 — It may depend on what you mean by 'undo changes', but I always thought that's what the 'back' button was for.

Or as a command, history.back();
Copy linkTweet thisAlerts:
@ironj32authorFeb 26.2010 — Sorry, I guess I should have elaborated a bit more. I'm actually looking for a function to use within a form, which will undo any changes made to all fields, and then go back to previous page. Using the browsers back button is not an option, as it has been made to end the users session if clicked. I tried the [B]history.back();[/B] command, but that seems to give me the same results as using the Browsers Back Button.

Thanks again for any help you can give.
Copy linkTweet thisAlerts:
@ironj32authorMar 01.2010 — Just thought I'd give an update. I came across this code and it seems to be working great. It takes you back to the previous screen without saving any of the changes. Basically, it works like the "X" button in the upper right corner of the window.

javascript:__doPostBack('Close','')
×

Success!

Help @ironj32 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.18,
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,
)...