Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
Dear all,

I am working on SURVEY PROJECT. (ASP.Net, C#, SQLSERVER 2005)

I have 15 Questions with Yes or NO Radio buttons on webform. its working fine and storing in database after submit button click.

Now , BESIDE that radio buttons I have a check box and TEXTBOX.

When i check(Tick) the Checkbox, The textbox should be displayed and User should enter the comments in the textbox and he should the submit it.


Note : if the user checks the CHECKBOX....the TEXTBOX must be displayed beside that checkbox....if not dont display.

Please can anybody can give the solution for this ?

Thank you very Much.
Posted
Updated 4-Jul-12 0:18am
v2
Comments
AmitGajjar 4-Jul-12 6:30am    
You really need to improve your english language.

Use this i:

Make Checkbox Autopostback Property True. and textbox visible=false


Then Double click on Checkbox :
if(chk.checked)
{
  textbox.visible=true;
}
else
{
  textbox.visible=false;
}


if not help to you , please post it.
 
Share this answer
 
v2
Comments
Ubaid ur Rahman IT 4-Jul-12 7:11am    
Thanks, it is Working Fine.
iamnishi 13-Jul-12 4:57am    
no...
i didnt work out...
i have textbox and label and by checking the checkbox the text feild is still not visible. I have set the property of textbox false. and on checking the Checkbox it will become visible. but is it not happening. plz..help me out with a solution.
[no name] 14-Jul-12 0:16am    
plz give me your code to solve the problem .
Nandhu_nands 13-Jun-19 1:33am    
same thing how to do when i click ok button in message box
JavaScript
<script language="javascript" type="text/javascript">
function forRentClicked(sender)
{
            var tb1 = document.getElementById('<%= TextBox1.ClientID %>');
            tb1.style.display = sender.checked?'inline':'none';
}
</script>

ASP.NET
<asp:checkbox id="CheckBox1" runat="server" onclick="forRentClicked(this)" checked="true" />
<asp:label id="Label1" runat="server" text="Rental rate per week:"></asp:label>
<asp:textbox id="TextBox1" runat="server" ></asp:textbox>



http://forums.asp.net/t/1632866.aspx/1[^]
 
Share this answer
 
v4
Did you try something? Try using the javascript for your requirement. You can see millions of examples in Google[^]
 
Share this answer
 
v3

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