473,382 Members | 1,329 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How do I check for changes in a user form?

I have a form with several fields (textbox, radio, checkbox), when the user
submits the form I want to check if the user have changed anything.

The check should be performed in the code-behind file.

Is this possible?
/Casper
Nov 18 '05 #1
3 1585
if you want to check using Request.Form[""], you cannot access the default
value.
If you want to perform this check only for server controls, you can have
Changed event handlers for all controls.

for html controls, you have to perform the check on the client side using
script.

Av.

"Casper Skovgaard" <ca**************@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
I have a form with several fields (textbox, radio, checkbox), when the user
submits the form I want to check if the user have changed anything.

The check should be performed in the code-behind file.

Is this possible?
/Casper

Nov 18 '05 #2
I only need to check for server controls. I have tried to do the
following:

On the controls I have added a OnTextChanged
<asp:textbox OnTextChanged="OnDocumentChanged"....

And created this method in the code-behind file
private bool IsDocumentChanged;

protected void OnDocumentChanged(object src, EventArgs e)
{
// event handler for all input fields
IsDocumentChanged = true;
}

The problem with that solution is that OnDocumentChanged is first
executed after Page_Load. I need to do one thing when then input is
changed and another thing if the input is not changed. I can't see how to
do that???

/Casper

"avnrao" <av*@newsgroups.com> wrote in
news:Ob**************@TK2MSFTNGP09.phx.gbl:
if you want to check using Request.Form[""], you cannot access the
default value.
If you want to perform this check only for server controls, you can
have Changed event handlers for all controls.

for html controls, you have to perform the check on the client side
using script.

Av.

"Casper Skovgaard" <ca**************@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
I have a form with several fields (textbox, radio, checkbox), when the
user
submits the form I want to check if the user have changed anything.

The check should be performed in the code-behind file.

Is this possible?
/Casper



Nov 18 '05 #3
Check for postback in your event handler first, don't set IsDocumentChanged
unless it is a postback.

"Casper Skovgaard" <ca**************@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
I only need to check for server controls. I have tried to do the
following:

On the controls I have added a OnTextChanged
<asp:textbox OnTextChanged="OnDocumentChanged"....

And created this method in the code-behind file
private bool IsDocumentChanged;

protected void OnDocumentChanged(object src, EventArgs e)
{
// event handler for all input fields
IsDocumentChanged = true;
}

The problem with that solution is that OnDocumentChanged is first
executed after Page_Load. I need to do one thing when then input is
changed and another thing if the input is not changed. I can't see how to
do that???

/Casper

"avnrao" <av*@newsgroups.com> wrote in
news:Ob**************@TK2MSFTNGP09.phx.gbl:
if you want to check using Request.Form[""], you cannot access the
default value.
If you want to perform this check only for server controls, you can
have Changed event handlers for all controls.

for html controls, you have to perform the check on the client side
using script.

Av.

"Casper Skovgaard" <ca**************@hotmail.com> wrote in message
news:Xn**********************************@207.46.2 48.16...
I have a form with several fields (textbox, radio, checkbox), when the
user
submits the form I want to check if the user have changed anything.

The check should be performed in the code-behind file.

Is this possible?
/Casper


Nov 18 '05 #4

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

Similar topics

2
by: Ben | last post by:
My current project requires me to create part of a form that is created on the fly. The project consists a list of entries to an event. The name and address and such is easy. The design is detup so...
8
by: Steve Jorgensen | last post by:
There's this app I wrote a long time ago for a client who uses it to administer the database content that drives their Web site. Last time I was in there' I notices a lot of embarassing typos in...
14
by: Ron L | last post by:
All I am working with a DataGrid and a form consisting of a number of text, checkbox, combobox controls, all bound to the same datatable. When I click on my "New" button, I create a new row,...
19
by: Taras_96 | last post by:
Hi everyone, How do you detect that a form element has been changed? This thread: ...
2
by: polocar | last post by:
Hi, I'm writing a C# program that interfaces with a SQL Server 2005 database (I use Visual Studio 2005 Professional Edition as compiler). I have defined the classical ADO.NET SqlDataAdapter,...
6
by: rojelio | last post by:
I have a form with many fields... the fields are getting values from a database. I've tried onunload to just submit the form regardless of changes or not but onunload and submit isn't working...
1
by: RP | last post by:
In my Form, I have 20 or 30 Text Boxes and Combo Boxes. I am using a tabbed interface. When the Form's Close button is clicked, I want to check whether user attempted an entry in any of the Text...
2
by: Ben | last post by:
Hi! All of a sudden on a newer version of our application a check box on the "Produce Invoice" form cannot be checked. I did not do any changes to this form at all. Below are the things that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.