473,660 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RequiredFieldVa lidator switching on and off AND TextChanged events not firing

1. I have a series of RequiredFieldVa lidators that need to be be
enabled/disabled depending on what the user types into various text
boxes.

Can I do this using the Enabled property of the validator. Or should I
use the CausesValidatio n on the control?

2. Also, with my text boxes, I am not getting the TextChanged events
firing. I tried changing the AutoPostBack property on the text box to
true but this still did not fire the event? What am I doing wrong?

(Note it is within these TextChanged events that I am attempting to
disable the validators).

Sorry if this is a simple ASP.NET question but I have mostly been using
WinForms.

Nov 15 '06 #1
1 3432

To answer your first question: yes, the Enabled property is how you turn
on/off validators.

As for the second question, setting AutoPostBack="t rue" and
OnTextChanged=" ..." should work. If you could post your code, it will
be easier for us to figure out what is going wrong.

-bgano

--
bgano
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 16 '06 #2

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

Similar topics

3
2924
by: Fabrício de Novaes Kucinskis | last post by:
Hi all, I have a combobox control, in wich I put an autocomplete code. This code is in the TextChanged event, but when this event fires, the Text property isn't updated yet. For example, if the Text property is "Foo" and I press the letter "d", the Text property when the TextChanged event runs is "Foo". Only after the TextChanged event be processed, the KeyDown, KeyUp and KeyPress events fires and update the Text property.
6
2148
by: BK | last post by:
I'm having a really strange problem with and HtmlSelect server control (listbox) and a RequiredFieldValidator that I am trying to use to make sure that someone has items in the listbox. The way that the HtmlSelect is populated is via a combination of client-side javascript and another aspx page (launched by the javascript). Anyway, everything seems to work just fine in terms of populating the HtmlSelect. However, when I postback the...
2
2184
by: jorge | last post by:
Hello I have the following situation: (everything is dynamic (controls.add)) 1. Button.Init { WasButtonClickFired = true } 2. TextBox.TextChanged { WasButtonClickFired?
1
3190
by: bill yeager | last post by:
I have two fields on my webform that I want calculated in my code-behind, but as I type in the controls, the events are not firing (as evidenced in debug mode). <code> Private Sub txtMileageBeginning_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtMileageBeginning.TextChanged If (txtMileageBeginning.Text.Trim <> String.Empty) AndAlso (txtEnding.Text.TrimEnd <>
3
2290
by: Mike | last post by:
Hi, I am adding controls dynamically in a WebForm, but none of these controls' events fire. Here is the class code I am using. I have tried so many things, but nothing works :-( namespace WebApplication1 { using System;
3
4621
by: Kurt Schroeder | last post by:
I'm setting focus depenting upon which field has changed value. I'm doing this with the following: Page.RegisterStartupScript("SetFocus", "<script language=""Jscript"" > document.getElementById(""txtCity"").focus(); </Script>"). This is being called on the textChanged event for textboxes. for city it goes to state for state it goes to zip, ... It works, but is this the correct way to do this or should this be a seties of if then else's in...
1
1926
by: Stan Sainte-Rose | last post by:
Hi, I have a problem with my textchanged and leave events I have a script in the leave event of my textbox and also in my textchanged. The script in my textchanged adds and displays a tabpage. By this action, automatically, the leave event executes its scripts and this is my problem. How can I remove or disable the Leave Event Script when I m in the textchanged. I suppose it's when the tabpage is added.
4
29800
by: Jason Huang | last post by:
Hi, In my C# Windows form MyForm I have some TextBoxes. In these TextBoxes, we have to detect if the TextChanged event occurs, if there're changes in these TextBoxes, it will ask if we want to save the changes when we close the form. However, when I run the MyForm, it will fetch data from the system and put into TextBoxes, and this incurs the textchanged event. But I am thinking how do I make the TextBox's TextChanged know the
1
2591
by: Arpan | last post by:
Suppose I have the following RequiredFieldValidator control which validates a TextBox: <form id="form1" runat="server"> <asp:TextBox id="txtVal" runat="server"/> <asp:RequiredFieldValidator id="reqVal" ControlToValidate="txtVal" ErrorMessage="Please enter a value in the TextBox!" Display="Dynamic" runat="server"/> <asp:Button id="but1" Text="SUBMIT" runat="server"/> </form>
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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
8754
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
8542
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
4177
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
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.