Hi there,
I'm new in this teleriks things. I try to enable/disable my textbox and combobox but it doesn't work. Below are my codes, can anyone help me on this.
<script language="javascript" type="text/javascript">
function CheckBox_Click(){
if(document.Form1.chkJrnlSeq.checked){
document.Form1.txtFrSeqNo.disabled = false;
document.Form1.txtToSeqNo.disabled = false;
}else{
document.Form1.txtFrSeqNo.disabled = true;
document.Form1.txtToSeqNo.disabled = true;
document.Form1.txtFrSeqNo.value = "";
document.Form1.txtToSeqNo.value = "";
}
if(document.Form1.chkProdType.checked){
var combo = <%=cboProductType.ClientID%>;
var input = document.getElementById(combo.InputID);
input.disabled = false;
}else{
var combo = <%=cboProductType.ClientID%>;
var input = document.getElementById(combo.InputID);
input.disabled = true;
}
}
</script>
.
.
.
.
.
<tr>
<td style="width: 15px">
<asp:CheckBox ID="chkJrnlSeq" runat="server">
</asp:CheckBox>
</td>
<td style="width: 150px">
<asp:Label ID="lblJrnlSeq" runat="server">1298^
<!--1298 - Journal Sequence-->
</asp:Label>
</td>
<td style="width: 300px">
<radI:RadTextBox ID="txtFrSeqNo" runat="server"
MaxLength="4">
</radI:RadTextBox>
</td>
<td style="width: 300px;">
<radI:RadTextBox ID="txtToSeqNo" runat="server"
MaxLength="4">
</radI:RadTextBox>
</td>
</tr>
<tr>
<td style="width: 15px">
<asp:CheckBox ID="chkProdType" runat="server">
</asp:CheckBox>
</td>
<td style="width: 150px">
<asp:Label ID="lblProdType" runat="server">1221^
<!--1221 - Product Type-->
</asp:Label>
</td>
<td style="width: 300px">
<radC:RadComboBox ID="cboProductType" runat="server"
AllowCustomText="False" Skin="WindowsOlive"
SkinsPath="~/RadControls/ComboBox/Skins"
AutoPostBack="False">
</radC:RadComboBox>
</td>
</tr>
In Code Behind :
I'm new in this teleriks things. I try to enable/disable my textbox and combobox but it doesn't work. Below are my codes, can anyone help me on this.
<script language="javascript" type="text/javascript">
function CheckBox_Click(){
if(document.Form1.chkJrnlSeq.checked){
document.Form1.txtFrSeqNo.disabled = false;
document.Form1.txtToSeqNo.disabled = false;
}else{
document.Form1.txtFrSeqNo.disabled = true;
document.Form1.txtToSeqNo.disabled = true;
document.Form1.txtFrSeqNo.value = "";
document.Form1.txtToSeqNo.value = "";
}
if(document.Form1.chkProdType.checked){
var combo = <%=cboProductType.ClientID%>;
var input = document.getElementById(combo.InputID);
input.disabled = false;
}else{
var combo = <%=cboProductType.ClientID%>;
var input = document.getElementById(combo.InputID);
input.disabled = true;
}
}
</script>
.
.
.
.
.
<tr>
<td style="width: 15px">
<asp:CheckBox ID="chkJrnlSeq" runat="server">
</asp:CheckBox>
</td>
<td style="width: 150px">
<asp:Label ID="lblJrnlSeq" runat="server">1298^
<!--1298 - Journal Sequence-->
</asp:Label>
</td>
<td style="width: 300px">
<radI:RadTextBox ID="txtFrSeqNo" runat="server"
MaxLength="4">
</radI:RadTextBox>
</td>
<td style="width: 300px;">
<radI:RadTextBox ID="txtToSeqNo" runat="server"
MaxLength="4">
</radI:RadTextBox>
</td>
</tr>
<tr>
<td style="width: 15px">
<asp:CheckBox ID="chkProdType" runat="server">
</asp:CheckBox>
</td>
<td style="width: 150px">
<asp:Label ID="lblProdType" runat="server">1221^
<!--1221 - Product Type-->
</asp:Label>
</td>
<td style="width: 300px">
<radC:RadComboBox ID="cboProductType" runat="server"
AllowCustomText="False" Skin="WindowsOlive"
SkinsPath="~/RadControls/ComboBox/Skins"
AutoPostBack="False">
</radC:RadComboBox>
</td>
</tr>
In Code Behind :
Private Sub Page_Load
(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
If Not Page.IsPostBack Then
WebFormTool.LoadLabelForWebControlCollection
(Me.Controls, CType(MyBase.objUserSession.GetSession
(GlobalVar.clsSessionVar.SessionItem.LANGUAGE), Language),
ColLanguageHastTable)
LoadComboData()'ignore this
chkJrnlSeq.Attributes.Add("OnClick", "CheckBox_Click()")
chkProdType.Attributes.Add("OnClick", "CheckBox_Click()")
End If
btnReset.Attributes.Add("onClick", "javascript:return resetValue();")
btnOK.Attributes.Add("onClick", "javascript:return OK_Click()")
End Sub