Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 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
Updated 5-Sep-12 5:02am
v2
Comments
[no name] 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

i want code for that
:doh:
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.
 
Share this answer
 
Comments
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    
5'ed!

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900