Link to home
Start Free TrialLog in
Avatar of ZoniacUser
ZoniacUser

asked on

Compare data change during form resubmission

When a HTML page the page is closed, we need to alert saying

"There are some data changed which is not saved, do you want to close?"

Is there JQuery built in method to know whether the form data is changed.

or need to follow a complex way,

1. Introduce a local java script variable and capture all the form data in onload event.
2. While Close the window, Compare the local java script variables and form input values, if there is a change alert.
SOLUTION
Avatar of Chris Stanyon
Chris Stanyon
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ZoniacUser
ZoniacUser

ASKER

I've requested that this question be deleted for the following reason:

I dont want
What do you mean you 'don't want'. You asked a question, and you got some answers. It's considered bad manners to just delete the question, without ever interacting with the Experts that tried to help you!!
This was done by mistake, we apologize for this.
We were waiting for a better solution, Both solution given works great.

But in here we are trying to say.

Ex.,

1. Say you have a page, which has a text field
2. The Text field is populated as "Java Developer" while page is loaded
3. The user removes the Java Developer and again types Java Developer
4. According to code the field is changed
5. But According to user the form is not changed.

We just want to know whether there is any built in solution for this in JQuery or to follow the traditional way (What we have done now)

1. Introduce a local java script variable and capture all the form data in onload event.
2. While Close the window, Compare the local java script variables and form input values, if there is a change alert.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial