473,406 Members | 2,698 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,406 software developers and data experts.

Odd validation problem

I have an odd problem with validation and I'm not sure if the problem's in
ASP, VB, Javascript, or a third-party component.

We created a user control (ASP1.1) that encapsulates a third party control
(a Telerik RadComboBox). It's really just a Yes/No option box. However due
to the Look & Feel of our application, the powers-that-be have decided that
it is necessary to allow text entry rather than making it mouse-selectable
only.

The problem is this. I added a custom validator to the control which calls
a javascript function within the control. The script simply compares the
current text with the possible selections in the list and returns false if
the text is not exactly one of the valid selections.

I had 3 of these controls on one screen and when I entered a partial
(incorrect) string in the last of the 3 controls, the validators for all
three fired. It seems that any one of these will set off all those above it.
Jan 24 '06 #1
2 1180
It sounds like the ControlToValidate property on all three CustomValidators
points to that 3rd control. Here's why. You are saying that all three fire
after an edit is made (not on submit). The ControlToValidate property hooks
up the "onchange" event handler to the control identified. It sounds like 3
validators all have their onchange event handler pointing to the same
control.

Now if this is only happening on submit, I would look for a hardcoded id
value in the javascript function. That id is pointing to the 3rd control.
Your function needs to be flexible enough to get values from any combobox by
getting the id through some other technique.

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

"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
I have an odd problem with validation and I'm not sure if the problem's in
ASP, VB, Javascript, or a third-party component.

We created a user control (ASP1.1) that encapsulates a third party control
(a Telerik RadComboBox). It's really just a Yes/No option box. However
due
to the Look & Feel of our application, the powers-that-be have decided
that
it is necessary to allow text entry rather than making it mouse-selectable
only.

The problem is this. I added a custom validator to the control which
calls
a javascript function within the control. The script simply compares the
current text with the possible selections in the list and returns false if
the text is not exactly one of the valid selections.

I had 3 of these controls on one screen and when I entered a partial
(incorrect) string in the last of the 3 controls, the validators for all
three fired. It seems that any one of these will set off all those above
it.

Jan 25 '06 #2
For now let me say that when I looked at the source of the returned page, it
looked like each validator was pointing to it's own instance. But then again
it could be a third party problem, since, strictly speaking, it was not
exactly an onChange event but a proprietary 'OnClientDropDownClosing' event.

Also, in case I was not clear enough, the custom validator (and the
Javascript) were a part of the User Control, not independent objects, so one
would expect them to point to their own instance of the dropdown.

I'm going to try this again when I have time. For now there's no time.

Thanks.

"Peter Blum" wrote:
It sounds like the ControlToValidate property on all three CustomValidators
points to that 3rd control. Here's why. You are saying that all three fire
after an edit is made (not on submit). The ControlToValidate property hooks
up the "onchange" event handler to the control identified. It sounds like 3
validators all have their onchange event handler pointing to the same
control.

Now if this is only happening on submit, I would look for a hardcoded id
value in the javascript function. That id is pointing to the 3rd control.
Your function needs to be flexible enough to get values from any combobox by
getting the id through some other technique.

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

"B. Chernick" <BC*******@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
I have an odd problem with validation and I'm not sure if the problem's in
ASP, VB, Javascript, or a third-party component.

We created a user control (ASP1.1) that encapsulates a third party control
(a Telerik RadComboBox). It's really just a Yes/No option box. However
due
to the Look & Feel of our application, the powers-that-be have decided
that
it is necessary to allow text entry rather than making it mouse-selectable
only.

The problem is this. I added a custom validator to the control which
calls
a javascript function within the control. The script simply compares the
current text with the possible selections in the list and returns false if
the text is not exactly one of the valid selections.

I had 3 of these controls on one screen and when I entered a partial
(incorrect) string in the last of the 3 controls, the validators for all
three fired. It seems that any one of these will set off all those above
it.


Jan 25 '06 #3

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

Similar topics

21
by: Stefan Richter | last post by:
Hi, after coding for days on stupid form validations - Like: strings (min / max length), numbers(min / max value), money(min / max value), postcodes(min / max value), telefon numbers, email...
41
by: Gérard Talbot | last post by:
Cross-posted to: comp.infosystems.www.authoring.html and alt.html Followup-to: comp.infosystems.www.authoring.html 1- One day, I stumbled across a website that offers to validate webpages. What...
3
by: Kent Ogletree | last post by:
I am porting a Java XML Validation class over to C# and I am having a problem finding exactly what I need to acomplish the task. First I need to test for well formedness. I know this is usually...
4
by: | last post by:
Hello Guys, I am using the validation controls to validate my data. But the problem is "The page is still being posted to server". I want to get rid of the round trips to server. Are there...
4
by: usl2222 | last post by:
Hi folks, I appreciate any assistance in the following problem: I have a form with a bunch of dynamic controls on it. All the controls are dynamically generated on a server, including all...
3
by: john morales | last post by:
Hi guys, I have a problem and i know there must be a solution for this as it is such a basic common practice in asp.net development. Scenario: i have many webforms in a site, most with two...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
4
by: David Colliver | last post by:
Hi all, I am having a slight problem that hopefully, someone can help me fix. I have a form on a page. Many items on the form have validation controls attached. Also on this form are...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.