Range validator and TextBox filled with JavaScript

M

MattB

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
 
P

Peter Blum

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: (e-mail address removed)
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top