Geek Articles

Categories

 

Subscribe

Daily Updates Subscribe geekarticles update via email Subscribe geekarticles update via RSS

 
GeekArticles Database SQL Server

Disabling the Submit Button Until a CheckBox is Checked

Author: aspnet.4guysfromrolla.com | Published: 20th Dec 2007 | Visited: 78 times | Add Comment
Filed in: SQL Server

ASP.NET provides a variety of validation Web controls that can be used to validate a user's form field inputs. Unfortunately, the validation Web controls do not work with the CheckBox or CheckBoxList Web controls. In a previous article, Creating Validator Controls for the CheckBox and CheckBoxList, I shared two custom controls I had created to address this shortcoming: CheckBoxValidator and CheckBoxListValidator. These controls work like any other ASP.NET validation control - at a minimum, just add them to a page and specify their ControlToValidate and ErrorMessage properties. A colleague recently asked me to enhance the CheckBoxValidator control's client-side script so that it could optionally disable a particular button when invalid. In particular, she wanted to be able to specify the ID of a Button control in the CheckBoxValidator's properties. The CheckBoxValidator would then use client script to disable (gray out) the Button when the CheckBoxValidator was invalid. The following screen shot illustrates this concept. On the left, the CheckBox is unchecked so the Submit button is grayed out; on the right, the CheckBox has been checked so the Button has become enabled. I recently updated the CheckBoxValidator to meet these specifications. Read on to learn more about this new enhancement to the CheckBoxValidator! Read More >

Read Article
 

Sponsored Links

 


Related Articles

 Triggering AJAX UpdatePanel from a Button Click or DropDownList Selection Change in Code-Behind This article shows how to make a Button click or DropDownList selection change trigger an update to an AJAX UpdatePanel with all code written in code-be ...

 CheckBox ComboBox Extending the ComboBox Class and Its Items An article on a CheckBox ComboBox control which extends the ComboBox.It ...

 A Managed C++ Button Control This is an example custom button control written entirely in managed ...

 Disabling an Event Handler After its First Exexcution in Delphi TIPS :: Have you ever wanted to keep an event from firing once it has executed? Simply set the event handler method to nil in the body o ...

 A Managed C++ Button Control This is an example custom button control written entirely in managed ...

 Check/uncheck CheckBox in a GridView using Javascript Check/uncheck CheckBox control inside a GridView using javascript without postb ...

 A templated PleaseWait Button, introduction to template Control The purpose of this article is to present the construction of a templated control, working as a PleaseWait bu ...

 Message box with any number of buttons and ?apply-my-answer-by-default? checkbox. Message box with any number of buttons and ?apply-my-answer-by-default? check ...

 Hint for "Delete" button says "Refactor" QC#: 59251 Version: 11.2 Status: Open defect, requires resolution Description: In the toolbar of the "Find references" result panel there are two buttons: "Delete" and "Delete All". The popup hint for the "Delete" button is incorrect: it says "Refa ...



Next: Dissecting ASP.NET Version 3.5's Web.config File



Post Comment

Name:


Email:
 (Optional. Used for Notification)

Title:

 
Comment:


Validation Code:
 <=>  (Enter this code in text box)





Latest Articles

 

Popular Articles

Sponsored Links