473,396 Members | 1,799 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,396 software developers and data experts.

Firing server object/web service from a client validation...

arc
I have a server object that performs zipcode validation based on zipcode
entered in the web form.
Ideally this should work as follows:
Once the zip code is entered in the edit box it should validate the
entry with this server object before moving to enter state in the next
dropdown field.

- What is the event by which we can do this for the edit box? (OnBlur doesnt
seem to capture the text though it fires up the server object)
- This works fine when the validation is performed at the server level but
user has to wait until the submit button is pressed, this is not feasible
here.

Thanks Much,
Arc
Jul 21 '05 #1
3 1388
If you write client-side javascript, you can trap the OnChange event of the
<input type="text" /> that you want to validate, and then either do your own
custom validation, or else call the ASP.NET validation system. I have always
called the ASP.NET validators as a whole, and not individually, so you would
have to poke through the script to see if you can get at this individually
or if you need to call validation on everything (which may cause problems if
you have required field validators that you haven't get gotten to on the
page). What I typically do is client-side validation where I present all of
the problems at the end, and then present very descriptive error messages
that point them to the control that is incorrect, rather than checking as
they type. If you wanted to get super-fast responses, you could trap
onkeydown and check after every keystroke, but that seems like overkill to
me.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"arc" <ar*@hotmail.com> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
I have a server object that performs zipcode validation based on zipcode
entered in the web form.
Ideally this should work as follows:
Once the zip code is entered in the edit box it should validate the
entry with this server object before moving to enter state in the next
dropdown field.

- What is the event by which we can do this for the edit box? (OnBlur
doesnt
seem to capture the text though it fires up the server object)
- This works fine when the validation is performed at the server level but
user has to wait until the submit button is pressed, this is not feasible
here.

Thanks Much,
Arc

Jul 21 '05 #2
First, I notice that you cross posted. Please don't do that as we cannot
follow all the responses elsewhere and may be wasting our time replying when
you already have a satisfactory response from another newsgroup.

You can write a CustomValidator to do this work. Internally the
customvalidator (and all validators) hook up to the onchange event of a
textbox. If you intend to maintain this validation on the client-side, it
may be very inefficient as you would have to provide a javascript
representation of all zip codes. That could make for a huge page. In this
case, I would recommend posting back to the server to do the work. Another
suggestion is to simply validate the pattern is ##### or #####-####. You can
use a RegularExpressionValidator to do this. Microsoft has even supplied a
regular expression for you in the property editor for the Expression
property.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"arc" <ar*@hotmail.com> wrote in message
news:uN**************@TK2MSFTNGP11.phx.gbl...
I have a server object that performs zipcode validation based on zipcode
entered in the web form.
Ideally this should work as follows:
Once the zip code is entered in the edit box it should validate the
entry with this server object before moving to enter state in the next
dropdown field.

- What is the event by which we can do this for the edit box? (OnBlur doesnt seem to capture the text though it fires up the server object)
- This works fine when the validation is performed at the server level but
user has to wait until the submit button is pressed, this is not feasible
here.

Thanks Much,
Arc

Jul 21 '05 #3
Peter Blum wrote:
First, I notice that you cross posted. Please don't do that as we cannot
follow all the responses elsewhere and may be wasting our time replying when
you already have a satisfactory response from another newsgroup.


That is not a problem with cross-posting. Replies in any group will be
propagated to all groups. Multi-posting (identical, *separate* posts to
different newsgroups) suffers from this problem and is a strict no-no.
Cross-posting to an excessive number of unrelated groups is frowned upon.

--
Steve

Common sense is the collection of prejudices acquired by age eighteen.
-Albert Einstein
Jul 21 '05 #4

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

Similar topics

3
by: arc | last post by:
I have a server object that performs zipcode validation based on zipcode entered in the web form. Ideally this should work as follows: Once the zip code is entered in the edit box it should...
8
by: John Dalberg | last post by:
I have an aspx page that was developed initially in Dreamweaver as a regular html file. I have added a few textboxes and required validators. The problem is that the client side validation is not...
4
by: Rolly Ferolino | last post by:
Has anyone encountered a problem where the validation events are not raised on a machine? These events are all working in our development environment but when we deploy them to WebHost4Life server,...
0
by: Demetri | last post by:
I have created a web control that can be rendered as either a linkbutton or a button. It is a ConfirmButton control that allows a developer to force a user to confirm if they intended to click it...
2
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of...
3
by: mark4asp | last post by:
How can I stop my Calendar control from firing the form validation events? I have a form containing several controls which have several validation controls each. One control is a TextBox...
3
by: Papanii | last post by:
Hello Guys, I have a little problem that i need some ideas as to how to solve. I have a form that sends some data to the server once filled. Now, for this form i am using asp.net validation...
1
by: Andrew Jocelyn | last post by:
Hi I have a Formview control in a UserControl. The server-side validation is not working, i.e. the events are not firing when a button control which causes validation is fired or even when...
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: 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...
0
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,...
0
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
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.