471,072 Members | 1,394 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,072 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 2727
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Dmitry Korolyov | last post: by
2 posts views Thread by Pham Nguyen | last post: by
4 posts views Thread by moondaddy | last post: by
5 posts views Thread by Roman | last post: by
1 post views Thread by tshad | last post: by
reply views Thread by sinureddy | last post: by
reply views Thread by beasers | last post: by
5 posts views Thread by =?Utf-8?B?Q2hyaXMgRA==?= | last post: by

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.