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

Range validator and TextBox filled with JavaScript

I have a page with dual controls for a person to enter their height and
weight. The dual controls are for English and metric units, and
Javascript onChange events handle populating the other control when one
if filled. This works well.
I also have some asp.net validation controls to make sure the values
entered are within certain limits. The problem I'm having is that if I
fill in my weight in the Lbs. TextBox, the Javascript fires and fills
the kg TextBox, but the range validator on the kg TextBox doesn't see
that the field has changed and displays it's error message.

Is there any way to "tell" the validator the text has changed via client
script?

Is there any other simple fix for this besides writing my own validator?

Thanks!

Matt
Nov 28 '05 #1
1 2837
In your javascript code, call this function to fire the validator:

ValidatorValidate(document.getElementById(' the ClientID of your validator
control goes here '));

Don't forget that javascript is case sensitive.

This function is found in the WebUIValidation.js file that is used for
client-side validation.

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

"MattB" <so********@yahoo.com> wrote in message
news:3v*************@individual.net...
I have a page with dual controls for a person to enter their height and
weight. The dual controls are for English and metric units, and Javascript
onChange events handle populating the other control when one if filled.
This works well.
I also have some asp.net validation controls to make sure the values
entered are within certain limits. The problem I'm having is that if I
fill in my weight in the Lbs. TextBox, the Javascript fires and fills the
kg TextBox, but the range validator on the kg TextBox doesn't see that the
field has changed and displays it's error message.

Is there any way to "tell" the validator the text has changed via client
script?

Is there any other simple fix for this besides writing my own validator?

Thanks!

Matt

Nov 30 '05 #2

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

Similar topics

8
by: Dmitry Korolyov | last post by:
ASP.NET app using c# and framework version 1.1.4322.573 on a IIS 6.0 web server. A single-line asp:textbox control and regexp validator attached to it. ^\d+$ expression does match an empty...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
4
by: moondaddy | last post by:
Is there a asp.net validator control that validates the length of the text being entered or does everyone just write jscript for this? -- moondaddy@nospam.com
2
by: Dot net work | last post by:
Hello. Say I have a .net textbox that uses a .net regularexpressionvalidator. If the regular expression fails, is it possible to launch a small client side javascript function to do something,...
5
by: Roman | last post by:
Hi, I am relatively new to dotnet and have heard great things about form validation and how easy it is. While I can see some improvements compared with classic asp I am a bit disappointed at...
1
by: tshad | last post by:
I have been trying to set up a range validator and regular expression for my dates. I tried this: <asp:RangeValidator runat="server" ControlToValidate="AbsentFrom1" MinimumValue="12/31/1950"...
0
by: sinureddy | last post by:
I am working on ASP.Net2.0 I have a TextBox, a associated RequiredFieldValidator and a LookupButton. I do have a Save Button. Without entering anything in TextBox I clicked Save Button....
0
by: beasers | last post by:
Hi I can't find any other examples of this, but I have a simple text box with an accompanying range validator set to Min 0 and Max 99999. The validation works if I enter an illegal character...
5
by: =?Utf-8?B?Q2hyaXMgRA==?= | last post by:
Hi - I was hoping to use the range validator to check that the user's age is between 10 & 65 based upon an entered DOB. I thought I could use max&min date variables in the Validator & have those...
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...
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
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
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...
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.