Click here to Skip to main content
11,478,896 members (59,458 online)
Rate this: bad
good
Please Sign up or sign in to 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 4-Jul-12 1:00am
Edited 4-Jul-12 1:18am
v2
Comments
amitgajjar at 4-Jul-12 6:30am
   
You really need to improve your english language.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Did you try something? Try using the javascript for your requirement. You can see millions of examples in Google[^]
  Permalink  
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<script language="javascript" type="text/javascript">
function forRentClicked(sender)
{
            var tb1 = document.getElementById('<%= TextBox1.ClientID %>');
            tb1.style.display = sender.checked?'inline':'none';
}
</script>
<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[^]
  Permalink  
v4
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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.
  Permalink  
v2
Comments
Ubaid ur Rahman IT at 4-Jul-12 7:11am
   
Thanks, it is Working Fine.
iamnishi at 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.

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 200
1 F-ES Sitecore 195
2 Frankie-C 120
3 OriginalGriff 105
4 DamithSL 95
0 Sergey Alexandrovich Kryukov 7,880
1 OriginalGriff 7,341
2 Sascha Lefèvre 3,064
3 Maciej Los 2,491
4 Richard Deeming 2,335


Advertise | Privacy | Mobile
Web01 | 2.8.150520.1 | Last Updated 4 Jul 2012
Copyright © CodeProject, 1999-2015
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