Solved

C# Code Behind Label Validation Event

Posted on 2014-09-26
2
275 Views
Last Modified: 2014-10-02
I have a form that has a TextBox and DropDownList .    I need to validate that something is entered into the TextBox when "CONMX" is selected in the dropdown.    The TextBox ID is "Conmx" and the DropDown ID is CondBY,    

When "CONMX" is selected in the dropdown, Label1 should display on the Markup Page form if the user attempts to submit prior to entering something into the text box.
Back.docx
0
Comment
Question by:BOEING39
2 Comments
 
LVL 15

Accepted Solution

by:
Ess Kay earned 500 total points
ID: 40352485
add to ONCLICK for submit button
    inside code:

      if (CONMX.text.length = 0) then {

       label1.text = "text not entered"
     }else {
      ...submit...
     }
0
 

Author Closing Comment

by:BOEING39
ID: 40358154
That worked - thx
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Google Directions API to Map URL -C#? 3 47
Name Space error VS2015 1 37
Web page design problem 3 18
How to set focus on a dynamic control 18 28
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question