473,698 Members | 2,376 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1148
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.co m> wrote in message
news:uN******** ******@TK2MSFTN GP11.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 RegularExpressi onValidator 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"arc" <ar*@hotmail.co m> wrote in message
news:uN******** ******@TK2MSFTN GP11.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
1401
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 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...
1
8394
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 I want to do is to allow the user to click on the row that corresponds to the correct address, and have the code behind populate the form's Address1, Address2 etc. controls with the relevant data items. I put the code for this into the...
8
5993
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 firing. Only server side is working - I have verified javascript is enabled - aspnet_client folder is present. Other aspx apps with validation work fine. - I can see validation JS code in the html plus the "onsubmit="if (!ValidatorOnSubmit())...
4
1065
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, the events are not raised. Is this something to do with differences in configuration, .NET Framework version, service packs, etc. Just want to know if you, folks, have experienced /encountered this, especially those who are using WebHost4Life...
0
2953
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 such as when they do a delete. Everything is great. By and large it will be used in my repeater controls using the command event when the user clicks on it and so that event is working great. My issue is the Click event. When the control is...
2
6956
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 attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
3
2172
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 where the date is entered. Connected to this is an image button which launches a popup window containing a calendar control. The selected value from the calendar is then fed back to the TextBox.
3
2864
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 controls to ensure certain fields are filled and also have the correct data format. What i want to have happen is once the form has been validated and the submit button clicked, i want a javascript function to fire before continuing with the server...
1
3099
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 Page.Validate() is explicitly called. I'm loading the FormView as an IBindableTemplate as in this article but I don't think this is the reason for the validation not working. http://www.developerfusion.co.uk/show/4721/
0
8676
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
8608
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4370
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...
3
2006
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.