Velocityman
Programmer
Here is the info need. I wanted to disabled the asp textbox when radiobutton list is set to "No" and enabled when set to "Yes". It doees not toggle. Any help will be greatly appreciated. Thanks!!
javascript:
function SetMemoSectionOpen()
{
var txt
var rgrp = document.getElementsByName("<%=RadioButtonList5.ClientID%>");
for(var i = 0; i < rgrp.length; i++)
{
if(rgrp.type == 'radio')
{
if(rgrp.checked == true)
{ txt= rgrp.value;
}
}
}
alert(txt)
if (txt = "No") {
document.getElementById('tbRevMaxDesc').disabled = true;
}
else
if (txt = "Yes")
{
document.getElementById('tbRevMaxDesc').disabled = false;
}
}
.aspx page elements:
RadioButtonList:
<asp:RadioButtonList ID="RadioButtonList5" runat="server" onclick="SetMemoSectionOpen();"
TabIndex="67" Width="500" style="margin-left: 66px">
<asp:ListItem Value="Yes">
Yes
</asp:ListItem>
<asp:ListItem Value="No">
No
</asp:ListItem>
</asp:RadioButtonList>
Asp TextBox:
<asp:TextBox ID="tbRevMaxDesc" TabIndex="68" runat="server" Width="600" Height="600" MaxLength="1000"
TextMode="MultiLine" OnKeyUp="textCounter(tbRevMaxDesc, this.form.tbRevMaxDescCharCount, 1000);"
OnKeyDown="textCounter (tbRevMaxDesc, this.form.tbRevMaxDescCharCount, 1000);"
BorderStyle="Solid" style="margin-left:0px" BorderWidth="1px"></asp:TextBox>
javascript:
function SetMemoSectionOpen()
{
var txt
var rgrp = document.getElementsByName("<%=RadioButtonList5.ClientID%>");
for(var i = 0; i < rgrp.length; i++)
{
if(rgrp.type == 'radio')
{
if(rgrp.checked == true)
{ txt= rgrp.value;
}
}
}
alert(txt)
if (txt = "No") {
document.getElementById('tbRevMaxDesc').disabled = true;
}
else
if (txt = "Yes")
{
document.getElementById('tbRevMaxDesc').disabled = false;
}
}
.aspx page elements:
RadioButtonList:
<asp:RadioButtonList ID="RadioButtonList5" runat="server" onclick="SetMemoSectionOpen();"
TabIndex="67" Width="500" style="margin-left: 66px">
<asp:ListItem Value="Yes">
Yes
</asp:ListItem>
<asp:ListItem Value="No">
No
</asp:ListItem>
</asp:RadioButtonList>
Asp TextBox:
<asp:TextBox ID="tbRevMaxDesc" TabIndex="68" runat="server" Width="600" Height="600" MaxLength="1000"
TextMode="MultiLine" OnKeyUp="textCounter(tbRevMaxDesc, this.form.tbRevMaxDescCharCount, 1000);"
OnKeyDown="textCounter (tbRevMaxDesc, this.form.tbRevMaxDescCharCount, 1000);"
BorderStyle="Solid" style="margin-left:0px" BorderWidth="1px"></asp:TextBox>