473,503 Members | 13,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web form validation vs object validation

Hi,

I have a web form which takes daily sales totals, both counts and monetary
value and is done on a weekly basis, so on a Monday morning the User would
enter these totals. Each total has a range, which at the lower end is >= 0
and the upper limit is configurable, these totals are then submitted to a
web service which posts them to a data store.

The question is regarding validation, obviously I can validate on the web
form using RangeValidator, and I was thinking of using an event to track
which control had focus and then modify the ControlToValidate accordingly.
So my first question would be how do you track on a web form which control
has focus using an event?

However perhaps a broader question would be: surely it would be better to
simply submit the whole object which holds the totals, and return any error
message, to the erring control, however that gets complicated if there is
more than one error, this would involve the whole object to-ing and fro-ing
between the web service and the web form?

Any thoughts anyone?
Many thanks
Colin
Nov 18 '05 #1
1 1615
1. You just create a RangeValidator for each control you want to
validate on
your webform. Why do you want to share one RangeValidator control?

2. There is a validation summary control that will display all error
messages
of all the validation control on the client side.

Could you explain your process flow further in detail? It seems that
you could just do #1 and #2, and if it is successful, then your
webform that submit the the data to the web service.

Tommy,

"Colin Basterfield" <co**************@hotmail.com> wrote in message news:<O0**************@TK2MSFTNGP09.phx.gbl>...
Hi,

I have a web form which takes daily sales totals, both counts and monetary
value and is done on a weekly basis, so on a Monday morning the User would
enter these totals. Each total has a range, which at the lower end is >= 0
and the upper limit is configurable, these totals are then submitted to a
web service which posts them to a data store.

The question is regarding validation, obviously I can validate on the web
form using RangeValidator, and I was thinking of using an event to track
which control had focus and then modify the ControlToValidate accordingly.
So my first question would be how do you track on a web form which control
has focus using an event?

However perhaps a broader question would be: surely it would be better to
simply submit the whole object which holds the totals, and return any error
message, to the erring control, however that gets complicated if there is
more than one error, this would involve the whole object to-ing and fro-ing
between the web service and the web form?

Any thoughts anyone?
Many thanks
Colin

Nov 18 '05 #2

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

Similar topics

5
4019
by: Weston C | last post by:
I'm trying to write a generic/reusable form validator in Javascript... just something that checks to make sure required fields have a value. By generic I mean I don't want to explicitly reference...
72
5137
by: Stephen Poley | last post by:
I have quite often (as have probably many of you) come across HTML forms with irritating bits of Javascript attached. The last straw on this particular camel's back was a large form I was asked to...
4
2530
by: TJS | last post by:
how do I get "onSubmit" to work in .net ? <Form id="Form1" name="Form1" method="post" onSubmit="return validateStandard(this, 'error');" runat="server">
7
1228
by: Dave Wurtz | last post by:
All, Not sure if I'm taking the correct approach or not, but here it is... I have my business object with a property. I want to validate the Setting of this property with the business object....
9
4153
by: julie.siebel | last post by:
Hello all! As embarrassing as it is to admit this, I've been designing db driven websites using javascript and vbscript for about 6-7 years now, and I am *horrible* at form validation. To be...
2
4854
by: this one | last post by:
I have the following code <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script language="JavaScript"...
27
4679
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
11
2961
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
7
3580
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7366
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...
1
7017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4698
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...
0
3187
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...
0
1526
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 ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
406
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...

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.