Click here to Skip to main content
15,949,686 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello ,...
i want to make a textbox visible when the user mark on check box
i did this and write a code in the button .but it is apear after postpack

i want to do this without postpack

can anyone tell me how can i do that
Posted

Your can try apply ajax update panel that can solved your postback
problem.
 
Share this answer
 
Comments
Hercal 5-Mar-11 5:01am    
Thank you Member 7677684 ,.........
i develop my website on ASP.net 2.0 which dont contain update panel :(
so i don't know what can i do :( :(
i want to do this without postpack
You can do it using Javascript.

Attach a client-side onclick handler to the checkbox and tie a Javascript method to it. Thus, on click of the checkbox, this Javascript method would be raised and you can set the visibility(use display style for hiding/showing) of the textbox as per your need.

Try!
 
Share this answer
 
Comments
Hercal 5-Mar-11 4:59am    
Thank you , Sandeep Mewara ....
can u tell me the steps please , i dont know anything about javascript
Sandeep Mewara 5-Mar-11 5:08am    
I did told the steps!

For code, try first... Google.. read.. learn...
If I give you a code, you will just copy-paste and done - I dont want that.
Hercal 5-Mar-11 5:56am    
ok , thanks 4 your effort , i will try
If you want to avoid postback, then have a textbox with display property as none ( Keep in mind that visible false would not work, you have to style display as none from code behind). Then write a javascript function at Client side to display/hide the textbox, using it's client id and attach the function with checkbox.
 
Share this answer
 
Comments
Hercal 5-Mar-11 4:57am    
Thank you Brij ,...

sorry but how i can have a textbox with display property as none ???
how can i write java script function ?? i dont know anything about javascript :( :(
###### Keep in mind that visible false would not work######..........why not work ??

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