NEWBIE: check if page has been changed

  • Thread starter Marco Krechting
  • Start date
M

Marco Krechting

Hi All,

I have a rather strange question but maybe one of you guys can answer.
I have a ASP page with a recordset showing records from my database.
Every record has some checkboxes attached to it.

What I want to have is a check if the user clicked or unclicked some of
these checkboxes when he goes to another page without clicking the Update
Database button.

In other words when the user made changes to the database these will be lost
when he goes to another page without updating the database. That i want to
prevent.

Regards
Marco
 
Y

yzzzzz

Marco said:
In other words when the user made changes to the database these will be lost
when he goes to another page without updating the database. That i want to
prevent.

What you are saying is: if you don't update the database, the database
doesn't get updated.
Makes sense. What if the user clicked the checkboxes, but then changed
their mind and deliberatly didn't click the update button?

Anyway to answer you question: you need some sort of client-side
javascript that auto-submits the data (<input type="checkbox"
onclick="document.getElementById('updatedbform').submit()">) as there is
no other way the server can be aware of what happens in the browser. But
this is javascript and therefore off-topic here.

Hope this helps.
 
A

Andrew Thompson

I have a rather strange question ..

Probably in more respects than you first think.
..but maybe one of you guys can answer.

...and maybe you have the wrong group.
I have a ASP ..

So it churns out HTML? Maybe..
<http://groups.google.com.au/groups?group=comp.infosystems.www.authoring.html>

No?
..page with a recordset showing records from my database.
Every record has some checkboxes attached to it.

What I want to have is a check if the user clicked or unclicked some of
these checkboxes when he goes to another page without clicking the Update
Database button.

What you are after probably cannot be done at all, and if so, only in
such an unreliable way that it is useless, but if there is *any* avenue
to achieve what you want, it might come from JavaScript.
In other words when the user made changes to the database these will be lost
when he goes to another page without updating the database. That i want to
prevent.

And this reveals the real basis of the defeat. Trying to 'force'
or 'prevent' the user doing pretty much anything is bound to fail.
As perhaps best discussed on..
<http://groups-beta.google.com/group/comp.infosystems.www.authoring.site-design>


You should revise your design to be able to handle the user
doing this, including something as simple as putting..

<p>Warning! Click 'Submit' before surfing to another
page or you will lose your updates.</p>

But then, most web surfers understand that already.

Oh, and BTW, note that none of the groups mentioned above,
is this one. Java is a separate language to JavaScript.
<http://www.physci.org/codes/javafaq.jsp#js>

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,832
Latest member
GlennSmall

Latest Threads

Top