473,323 Members | 1,537 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,323 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
Nov 18 '05 #1
3 1136
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

Nov 18 '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

Nov 18 '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
Nov 18 '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...
1
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...

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.