...

View Full Version : How to delect the changes made in the WebPage...??



murali1983
02-05-2007, 06:01 AM
Hi

how can i know wheather there are any changes done to the page...from the time the page is opened...

onclick of a Cancel Button....am showing a confirmation alert saying

" Any changes done to the Screen will not be saved, do you wish to proceed..? "

i need this alert only when user had made changes....if not i need a different alert msg....


how can i acheive this..,is ther any simple way....plz..help me.......

tonyp12
02-05-2007, 07:38 AM
What?
A user can not change a webpage.

A user can change the text in a input box or a textarea if ReadOnly is not applied.

if so use: onChange="function()"

murali1983
02-05-2007, 12:19 PM
i mean my application is web based...and i wanted to detect the changes made in the page..based on which appropiate alert is shown....

Kor
02-05-2007, 12:51 PM
As tonyp12 said: A user can not change a page, unless you invite and let him to do that in a server-side way mode. He can change locally the appearance of the page (but only for him or only on it's browser) but only if you, as the web designer, let him to do that. So that it looks a nonsense to me to alert " Any changes done to the Screen will not be saved, do you wish to proceed..? ". Either you let the user to do that (by using cookies or submit it's own data, after a registering, to a DB) or you build a simple page which user can not modify it.

So: what do you really mean by "changing the page"?

tonyp12
02-05-2007, 07:09 PM
Murali, I take it you are none English speaking?

I don't get what you are asking for?

I made a javascript application that shows yes/no buttons
after another button is pressed just to confirm. (hidden>visable)

If you click on 'any' other button or change any <select> the yes/no buttons goes away

Is this what you want?
I simple included 'hideask()' in the first line of every functions
that is called when any other button is pressed.

scrupul0us
02-05-2007, 07:15 PM
i think what hes trying to convey is:

-he has a web application
-currently if ANY changes are made, there is only one default alert
-he wants the alerts to be "intuitive" to react to certain changes on certain parts of of the application

am i correct Murali?

Kor
02-05-2007, 08:19 PM
i think what hes trying to convey is:

-he has a web application
-currently if ANY changes are made, there is only one default alert
-he wants the alerts to be "intuitive" to react to certain changes on certain parts of of the application

am i correct Murali?
What do you (or he) mean by web application, either?:)

chump2877
02-05-2007, 09:53 PM
Why would you want an alert to pop up every time something changes client side? How annoying is that?

Generally, I think you should only use alert to "alert" the user that something is wrong or as a warning, not to notify him/her that something has changed...

scrupul0us
02-05-2007, 10:38 PM
maybe its validation and he/she wants different alerting based on what is erroneous

e.g.:

that is an invalid email address
that is an invalid telephone number

instead of just "you have an error"

murali1983
02-06-2007, 04:11 AM
Sorry for my confusing question.....


i have a web application, currently on click of cancel button there is only one default alert
please dont get confused with webpage where the user cant change anythin...i am talking about web application.

in my appln ther's an page in which user enters invoice details like
amount 1 :
amount 2 :
amount 3 :
and many other information and clicks on the SAVE button...
now the information he entered is saved in the database, now if the user clicks on the
CANCEL button i need a alert saying "do you want to cancel the page"

and after SAVING if he makes some changes and then
clicks on the
CANCEL button i need a alert saying "changes have been made, do you want to cancel the page "

how can i know wheather ther's any change in the page after save...

i hope u guys understood my question...

tonyp12
02-06-2007, 05:38 AM
If I get you correctly.

A webpage loads with blank boxes to input data.

User inputs data and clicks save. (alert= data saved)
Or user can click cancel. (alert= do you want to cancel the page)

After the Save, the data is still in the boxes
and the user 'can' change it.


If the user clickes save (alert= data saved)
user click cancel (alert= do you want to cancel the page)
user click cancel after something was changed (alert= changes have been made, do you want to cancel the page)

Seems to be that you need keep a buffer of the data after it was saved
and compare it when user clicks cancel.

or

you could have each box with a onchange="didchange()"

function didchange(){
document.getElementById('cancelbutton').value = 1; // just an easy way to get global variable
}

After a save:
document.getElementById('cancelbutton').value = 0

And the cancel alert will simple check the value.

confirm (document.getElementById('cancelbutton').value==1 ? "changes have been made, do you still want to exit the page" : "do you want to exit the page")
But it will still alert that something changed even if the user change and then later changed back.

What do you use?, <form> , a link to your web app?, copy the form here for us to see?
Do you use confirm as the alert?
To choose OK/Cancel to the question:"do you want to cancel" could be confusing.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum