473,770 Members | 5,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting values that have changes on a post back

Hi all,

Is there any easy way to check a field for calues that have changed on a
post back.

So the page is sent to the user, the user changes some values and I need to
know which ones changed.

Is the only way to do this to go through all the fields and check them
against their old values. In which case, would I need to store the values in
the session object so I could tell what the old values were?

This sounds a bit messy so I'm hoping there is some easier way.

Any help would be greatfully received

Thanks everyone

Simon
Nov 18 '05 #1
2 1404
Search on google for "javascript dirty flag", or something similar. Some
sites use an OnChange attribute in the html input fields, and set a
variable for each field indicating whether than field has been altered.

Basically, each field has its own hidden field, with an initial value=0.
Each input field has its own OnChange event that sets its relative hidden
field value to 1. When the form posts back you just check the hidden
fields to see what changed.

It's not a great solution, but sometimes desirable.

--
CharlieN
VSU

This posting is provided "AS IS" with no warranties, and confers no rights.

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
From: "Simon Harvey" <si**********@t he-web-works.co.uk>
Subject: Detecting values that have changes on a post back
Date: Wed, 28 Apr 2004 17:12:32 +0100
Lines: 21
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
Message-ID: <#p************ **@tk2msftngp13 .phx.gbl>
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
NNTP-Posting-Host: firewall.the-web-works.co.uk 217.15.160.2
Path: cpmsftngxa10.ph x.gbl!TK2MSFTFE ED01.phx.gbl!TK 2MSFTNGP08.phx. gbl!tk2msftngp1 3
.phx.gbl Xref: cpmsftngxa10.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:2295 77
X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet

Hi all,

Is there any easy way to check a field for calues that have changed on a
post back.

So the page is sent to the user, the user changes some values and I need to know which ones changed.

Is the only way to do this to go through all the fields and check them
against their old values. In which case, would I need to store the values in the session object so I could tell what the old values were?

This sounds a bit messy so I'm hoping there is some easier way.

Any help would be greatfully received

Thanks everyone

Simon


Nov 18 '05 #2
Thanks for that
Nov 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2734
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the desktop resolution. I have tried trapping the following events: 1) SDL_ACTIVEEVENT 2) SDL_VIDEOEXPOSE
1
2860
by: Erik Bethke | last post by:
Hello All, I am trying to clean up some polish bugs with the Shanghai game I am working on and I am currently stuck on trying to get the right event for detecting when the user has changed the desktop resolution. I have tried trapping the following events: 1) SDL_ACTIVEEVENT 2) SDL_VIDEOEXPOSE 3) SDL_VIDEORESIZE
6
4216
by: Thomas Mlynarczyk | last post by:
Hi, Say I have an array containing a reference to itself: $myArray = array(); $myArray =& $myArray; How can I, looping iteratively through the array, detect the fact that $myArray will "take" me to where I have already been? The print_r() and var_dump() functions print *RECURSION* in such a case (though only after the "second round"). Setting a flag seems to be the only solution, but I don't want to modify the array in question - I...
5
8868
by: Lars Moastuen | last post by:
Hi! I'm currently playing around with a project where I need to know if an object (any object) has been altered since last check. I need this to know when an object needs to be saved... My idea was to represent the object as a byte-array and then make a MD5-hash out of that byte (not very efficient though - but that won't really be a big problem here)... I guess that works fine as long as the object I need to check for updates doesn't...
7
1858
by: Simon Harvey | last post by:
Hi everyone, I'm having a frustrating problem and I don't know how to fix it without totally redoing a very complicated couple of pages on my site. I really hope some kind soul can help me :-) Its a very simple situation: I have 1 page that serves to create and update users and another page to add roles to the user.
4
5043
by: Larry Grady | last post by:
Anyone up for a challenge? I've been struggling with this for a few days and was hoping someone could help me. Pouring through all the messageboards I just can't find the solution. We have a GridView that needs to be dynamically designed, depending on what collection of fields our uses want to edit for their product data. We have 400+ fields of information per product so they're selecting a subset of those fields to edit.
5
1836
by: needin4mation | last post by:
Hi, I have an asp.net 1.1 application that populates data from a database. When the user changes data, they have to hit a button to update the data. The data entry form (same form that is populated) is from several different tables. To the user, of course, this is not seen. Scenario: After the page is populated, assume a change is made to the form and the user hits update. The page then goes back, reads the database for that record...
79
3794
by: VK | last post by:
I wandering about the common proctice of some UA's producers to spoof the UA string to pretend to be another browser (most often IE). Shouldn't it be considered as a trademark violation of the relevant name owner? If I make a whisky and call it "Jack Daniels", I most probably will have some serious legal problems. "Mozilla" partially appeared because NCSA stopped them from using "Mosaic" in the UA string. Is it some different...
2
20245
by: David Jackson | last post by:
Hello, I have an unbound DataGridView of which one of the columns is a ComboBox colum containing category data, plus an additional option called <newSo when the ComboBox is dropped down it looks like this <new> First Second Third
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10053
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3969
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3573
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.