473,668 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2848
In your javascript code, call this function to fire the validator:

ValidatorValida te(document.get ElementById(' 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"MattB" <so********@yah oo.com> wrote in message
news:3v******** *****@individua l.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
2017
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 string (when you don't enter any values) - this is wrong d+ expression does not match, for example "g24" string - this is also wrong www.regexplib.com test validator works fine for both cases, i.e. it is reporting "not match" for the...
2
3904
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 javascript checks for things like valid e-mail addresses or phone numbers (without having to add a separate control for validation). One idea I did some work on was having the control implement the IValidator interface and basically recreating...
4
9894
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
9861
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, such as change the border color of the textbox to red? That would look quite nice: if the expression fails, the red validator text is shown, plus the textbox's border goes red. TIA,
5
2469
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 how inflexible it seems. The requirement I have is that when form fields contain invalid data, ie not filled in, incorrect date etc, the background color of the form field must be set to red until the data is valid. After playing around with the...
1
2023
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" MaximumValue="1/1/2100" Type="Date" text="Invalid Date"/>
0
1171
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. Required Field Validator is visible now. I click on Lookup Button and a new window is popped up from where I select a value and click the OK Button present in Popup. Clicking the
0
1045
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 like 'p', and the validation works for negative values but 44444444 gets through (and I am trace.writing the validation result so I know it's returning TRUE). However 99999999 gets caught by the validation. My suspicion is that the range validator...
5
1841
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 populated in the page_load event based on today's date. Dead end so far. Please HELP! Many thanks ... c
0
8890
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
8791
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
8575
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
7398
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...
1
6206
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4202
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...
0
4373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2784
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.