Click here to Skip to main content
13,045,248 members (44,902 online)
Rate this:
Please Sign up or sign in to vote.
See more:
if textbox is empty then error message is there,on text changed event..
i want code for that...plz help me..
Posted 5-Sep-12 5:01am
Updated 5-Sep-12 5:02am
Wes Aday104.2K
Wes Aday 5-Sep-12 11:03am
So you have not actually tried anything and you just want someone to write some code for you?

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

i want code for that
It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.

For now, you need to:
Option #1:
Handle/Validate it on client side itself. Use RequiredFieldValidator OR define a JavaScript onsubmit event of page where you check if the textbox has value or not

Option #2:
After page postback, in the submit event (if a button submitted the page), look for the text value and show a message in case value is nothing.

I would by far suggest option 1.
Try out and post specific issues if you have any.
Christian Amado 5-Sep-12 11:14am
True, true :)
Member 9332883 5-Sep-12 15:12pm
i have mention that i want to validate empty texbox on textchanged event...
Sandeep Mewara 6-Sep-12 0:59am

1. If there was a text change and an event was tied up and it was raised, should not there be somehting in the textbox to raise the event?
2. What you seek is not a favored implementation in todays world where performance is key and client side validations are preferred.
3. Whatever you mentioned, I replied something. Read it again. If you have too specific an issue, share your effort made and whats troubling you.
Espen Harlinn 6-Sep-12 10:14am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 5 Sep 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100