473,654 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RequiredField Validator question

Vi
Hi,
I have a TextBox control that needs to have a value only if a drop down box
on the same page has a certain value selected. Is it possible to achieve this
using RequiredFieldVa lidator for the TextBox and having EnableClientScr ipt =
true (without a post)?

Thank you
Nov 19 '05 #1
4 1190
Hi, although this could be accomplished with Custom Validators, the best
practice is probably to write the javascript validation yourself.

Hope that helps,

Jason Lind

"Vi" wrote:
Hi,
I have a TextBox control that needs to have a value only if a drop down box
on the same page has a certain value selected. Is it possible to achieve this
using RequiredFieldVa lidator for the TextBox and having EnableClientScr ipt =
true (without a post)?

Thank you

Nov 19 '05 #2
Vi
I tried to do this with Custom Validators, but it does not fire if the
textbox it validates is empty. So I need to define a RequiredFieldVa lidator
for the same textbox, but it has to be enabled only if a certain value is
selected in a dropdown list.

"Jason L Lind" wrote:
Hi, although this could be accomplished with Custom Validators, the best
practice is probably to write the javascript validation yourself.

Hope that helps,

Jason Lind

"Vi" wrote:
Hi,
I have a TextBox control that needs to have a value only if a drop down box
on the same page has a certain value selected. Is it possible to achieve this
using RequiredFieldVa lidator for the TextBox and having EnableClientScr ipt =
true (without a post)?

Thank you

Nov 19 '05 #3
Vi,

you certainly can :-) You can use ValidatorEnable to enable or disable any
validators on your page.
Basically it vorks like this:

ValidatorEnable (document.getEl ementById("your Validator"), false);
or
ValidatorEnable (document.getEl ementById("your Validator"), true); // what
a surprise ;-)

HTHs

Daniel Walzenbach
"Vi" <Vi@discussions .microsoft.com> schrieb im Newsbeitrag
news:15******** *************** ***********@mic rosoft.com...
Hi,
I have a TextBox control that needs to have a value only if a drop down
box
on the same page has a certain value selected. Is it possible to achieve
this
using RequiredFieldVa lidator for the TextBox and having EnableClientScr ipt
=
true (without a post)?

Thank you

Nov 19 '05 #4
Vi
Thank you,
That worked.

"Daniel Walzenbach" wrote:
Vi,

you certainly can :-) You can use ValidatorEnable to enable or disable any
validators on your page.
Basically it vorks like this:

ValidatorEnable (document.getEl ementById("your Validator"), false);
or
ValidatorEnable (document.getEl ementById("your Validator"), true); // what
a surprise ;-)

HTHs

Daniel Walzenbach
"Vi" <Vi@discussions .microsoft.com> schrieb im Newsbeitrag
news:15******** *************** ***********@mic rosoft.com...
Hi,
I have a TextBox control that needs to have a value only if a drop down
box
on the same page has a certain value selected. Is it possible to achieve
this
using RequiredFieldVa lidator for the TextBox and having EnableClientScr ipt
=
true (without a post)?

Thank you


Nov 19 '05 #5

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

Similar topics

24
3141
by: Nick Kew | last post by:
There's a new beta of the W3C Markup Validation Service now live at <URL:http://validator.w3.org:8001/> Probably the most important change is verbose output, including attempts to explain the validator errors. Other changes include improved display of error messages, and a choice of parse modes. Currently - but probably not for long - it includes an "interesting" default setting! Some of the changes have been the subject of much...
195
8519
by: Torbjørn Pettersen | last post by:
As you might have noticed I'm trying to clean up my web site's HTML code. The way I do it is simply more or less redoing to complete site, testing it on a web server I have set up on my local network. I have downloaded, and installed CSE HTML Validator Pro, but I don't get the same results with that as I do with the online validator on W3.org. And I can't upload files to W3.org either, due to all the ASP code I use.
13
10796
by: Niki Kovacs | last post by:
Hi, I'm an Austrian writer living in Montpezat (South France). I just installed a local W3C validator on my machine (Slackware 10.1, local Apache server). It's accessible as http://w3c-validator, because I'm on dialup and I want to check pages offline. Unfortunately, URL upload won't work, because the validator doesn't accept any URL's beginning with http://localhost.
2
2457
by: Sean | last post by:
Hi, I have 2 buttons A and B, textbox C and dropdown list D. When A is clicked, C is required field. When B is clicked, C and D are required fields. There is a dummy entry "please select" in the dropdown list. When B is clicked, D can't be the dummy option. I wonder what is the best practice for this case? I was thinking to use server-side validation for these controls, and created 2 RequiredField Validators and set them TRUE at...
0
7943
by: Bryce Budd | last post by:
Hello All, I've been a taker of information from newsgroups for a long time and thought I'd finally make a contribution back to the community whose supported me when I've needed it. After all before commercialization took over that was the beauty of the Internet! I've create a checkboxlist validator control...something MS should have done originally in my opinion, but nonetheless here it is. It's a C# control, sort of IE specific. ...
5
2445
by: Richard Payne | last post by:
Hi This is probably a newbie question but I can't seem to find a clear answer to the problem I have. I have created a Custom Validator control on my webform that works fine, but when I put the control in to the header section of my datalist it doesn't work, the ServerValidate event doesn't fire. I presume that I haven't wirded it up correctly.
4
1387
by: venky | last post by:
I have a question. I have two requiredfield indicators in my asp.net page and i have two buttons like getnextlead and getcustomer. I want the first requiredfieldindicator to be on for getnextleadbutton but not for getcustomer button and second indicator active for getcustomer button but not for getnextleadbutton. can anyone tell me how to do this?
40
5584
by: VK | last post by:
Hi, After the response on my request from W3C I'm still unclear about Tidy vs. Validator discrepansies. That started with <IFRAME> issue, but there is more as I know. Anyway, this very basic HTML page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN" "http://www.w3.org/TR/html401/strict.dtd"> <html> <head>
0
1104
by: =?Utf-8?B?QWJieQ==?= | last post by:
I have one form on the page but have multiple submit buttons for different elements. When clicking on a button not associated with the required elements the validator popup still comes up. How can I disable requiredfieldvalidator fields when I click on non associated button? NOTE:am doing this in asp.net 1.1
37
3654
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry over" when there are <br /tags involved...??? I've tried using <p style="font-weight: bold;"></p>, I've tried <blockquote></blockquote>...I just can't figure how I'm supposed to get the <b></btags to work for all the lines! Surely there must be...
0
8290
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
8815
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
8593
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7306
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
6161
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
5622
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
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
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.