TextBox appear depended on checkbox
-
<script language="javascript" type="text/javascript">
function forRentClicked(sender) { var tb1 = document.getElementById('<%= TextBox4.ClientID %>'); tb1.style.display = sender.checked ? 'inline' : 'none'; } </script>
_____________________________________________________________
<asp:CheckBox ID="CheckBox1" runat="server"
Text=" XS" onClick="forRentClicked(this)" Checked="True" /><asp:TextBox ID="TextBox4" runat="server" Height="19px" Width="80%" CssClass="123"
style="display:block;" ></asp:TextBox >how to set the default checkbox uncheck and the javascript can function ~ i want to create 5 check box while i'm click the text box appear~ thx
-
<script language="javascript" type="text/javascript">
function forRentClicked(sender) { var tb1 = document.getElementById('<%= TextBox4.ClientID %>'); tb1.style.display = sender.checked ? 'inline' : 'none'; } </script>
_____________________________________________________________
<asp:CheckBox ID="CheckBox1" runat="server"
Text=" XS" onClick="forRentClicked(this)" Checked="True" /><asp:TextBox ID="TextBox4" runat="server" Height="19px" Width="80%" CssClass="123"
style="display:block;" ></asp:TextBox >how to set the default checkbox uncheck and the javascript can function ~ i want to create 5 check box while i'm click the text box appear~ thx
Hi Michael, sorry but i think i dont understand your question... the Check-Status of an ASP Checkbox can be assigned within the ASP Tag (Checked="True|False") the Actual Script seems to be hiding showing the Textbox4 independend of other textboxes or checkboxes... So maybe you can give us more details... Martin
-
<script language="javascript" type="text/javascript">
function forRentClicked(sender) { var tb1 = document.getElementById('<%= TextBox4.ClientID %>'); tb1.style.display = sender.checked ? 'inline' : 'none'; } </script>
_____________________________________________________________
<asp:CheckBox ID="CheckBox1" runat="server"
Text=" XS" onClick="forRentClicked(this)" Checked="True" /><asp:TextBox ID="TextBox4" runat="server" Height="19px" Width="80%" CssClass="123"
style="display:block;" ></asp:TextBox >how to set the default checkbox uncheck and the javascript can function ~ i want to create 5 check box while i'm click the text box appear~ thx
I think you of just search for each component and just pieced it together yourself.
function forRentClicked(sender) {
var checked = document.getElementById('CheckBox1').checked; var textbox\_4 = document.getElementById('<%= TextBox4.ClientID %>'); if (checked == true) { textbox\_4.style.display = "block"; } else { textbox\_4.style.display = "none"; }
}
-
<script language="javascript" type="text/javascript">
function forRentClicked(sender) { var tb1 = document.getElementById('<%= TextBox4.ClientID %>'); tb1.style.display = sender.checked ? 'inline' : 'none'; } </script>
_____________________________________________________________
<asp:CheckBox ID="CheckBox1" runat="server"
Text=" XS" onClick="forRentClicked(this)" Checked="True" /><asp:TextBox ID="TextBox4" runat="server" Height="19px" Width="80%" CssClass="123"
style="display:block;" ></asp:TextBox >how to set the default checkbox uncheck and the javascript can function ~ i want to create 5 check box while i'm click the text box appear~ thx
Hello Michael5119,
has not "onclick"event,you can use
<input id="Checkbox1" type="checkbox" onclick="forRentClicked(this)"/>
to replace it.
-
Hi Michael, sorry but i think i dont understand your question... the Check-Status of an ASP Checkbox can be assigned within the ASP Tag (Checked="True|False") the Actual Script seems to be hiding showing the Textbox4 independend of other textboxes or checkboxes... So maybe you can give us more details... Martin
thx :)
-
Hello Michael5119,
has not "onclick"event,you can use
<input id="Checkbox1" type="checkbox" onclick="forRentClicked(this)"/>
to replace it.
thx ~ :)
-
I think you of just search for each component and just pieced it together yourself.
function forRentClicked(sender) {
var checked = document.getElementById('CheckBox1').checked; var textbox\_4 = document.getElementById('<%= TextBox4.ClientID %>'); if (checked == true) { textbox\_4.style.display = "block"; } else { textbox\_4.style.display = "none"; }
}
thx ~ :)