/    Sign up×
Community /Pin to ProfileBookmark

Hi,

I’ve a scenario to set a dirtyflag while the user trying to open another page before submit the form or save the data in the current page.

I need to get the confirmation from the user [using the dirtyflag] to close the operation and redirect to some other page.

In the page I’ve lot of controls. I can’t set the dirtyflag to all control’s all events.

Is there any common function /event to watch the event raised in the page.

Thanks.
SaaralPrian

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@FangNov 19.2007 — onunload or onbeforeunload
Copy linkTweet thisAlerts:
@Saaral_PrianauthorNov 19.2007 — Thanks 4 ur comment.

Can u write me a code snip?

Thanks.

Saaral Prian
Copy linkTweet thisAlerts:
@Saaral_PrianauthorNov 20.2007 — Hi,

Its showing message while unloading the page.

But in my case, if any changes on any controls I need to show this message otherwise no need to show message.

Can u help me on this?
Copy linkTweet thisAlerts:
@KravvitzNov 20.2007 — [url=http://www.sitepoint.com/forums/showthread.php?t=446437#post3214737]Check this out.[/url]
×

Success!

Help @Saaral_Prian 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.17,
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,
)...