Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old May 26th, 2010, 12:29 PM
Authorized User
Join Date: Nov 2005
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
Default RadioButtonList and TextBox validation

A RadioButtonList has three items. When choosing either of the first two options, I want to verify a separate textbox has something in it (namely an integer value); the third option in the RadioButtonList will not fire the validation.

Will any of the built-in validators do that?
Old May 26th, 2010, 03:32 PM
Authorized User
Join Date: Nov 2005
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts

I created a CustomValidator for this, and also included javascript for client side validation. It all works with one thing:
I have the CustomValidator's Text property set to *. When checking one of the two radio buttons that fire the validation, it puts the cursor in the textbox and shows the * as expected. However, when I enter a valid value into the textbox and move on to another control on the form, the * stays (submitting the form does work even though * is still there; may be confusing for users).

Compare this behavior to say the RequriedFieldValidator on a textbox. When the validated textbox is empty and it loses focus the * immediately appears and the focus stays on the textbox. But when a valid value is entered and focus is moved to another form control, the * disappears. How can I make my CustomValidator remove the * after a valid value is entered?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Textbox validation rhd110 .NET Framework 2.0 1 March 28th, 2007 02:49 PM
radiobuttonlist + textbox Bartdude ASP.NET 1.0 and 1.1 Basics 2 December 5th, 2006 10:38 AM
dynamic textbox shown when radiobuttonlist select debjanib ASP.NET 1.0 and 1.1 Basics 1 May 30th, 2006 09:44 PM
show dynamic textbox when radiobuttonlist selected debjanib ASP.NET 1.0 and 1.1 Professional 1 May 30th, 2006 09:42 PM
js validation for radiobuttonlist sureshdev786 C# 1 October 24th, 2005 02:02 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.