Checkbox ShowHide

Checkbox ShowHide

Hi all,

I'm working on Asp.net web application and I'm not a good developer :(
I've more than 5 checkboxes and textboxes,
I wana ask when the checkbox = checked a textbox should be visible
and if checkbox is unchecked txtbox should be hidden

every checkbox has one or more than one textboxes

I've written some code with google help. when i check the checkbox  textbox get visible
when i uncheck the checkbox textbox dose not get invisible.
I need both function show and hide

I hope you got my point
is there any way to handle this
I would appreciate help


  1. <script language="javascript" type="text/javascript">
            $('#' + '<%=CheckBox1.ClientID%>').change(function () {
                    showHide();
                });
            });
    function showHide() {
                var checkBox = $('#' + '<%=CheckBox1.ClientID%>');
                var checkedBox = checkBox.click();
                var txtBox = $('#' + '<%=TextBox1.ClientID%>');
                if (checkedBox.click()) {
                    txtBox.show();
                }
                else {
                    txtBox.hide();
                }
            }
        </script>