Hello All,
I am newly learning asp.net and javascript.
I have an issue while working today. I am having 13 test boxes on the ajax tab container and have 4 Items in the asp.net drop down. Which are "Select", "R1", "R2", "Other". Procedure is as follows.
If user Selects Select then All 13 text boxes shoule be cleared.
If user selects "R1" Then 13 text boxes should load individaul values such as txtprodtion = 50, txtqualty = 10 etc.
If user selects "R2" Then 13 text boxes should load individaul values such as txtprodtion = 30, txtqualty = 30 etc.
I am uning the following fuction in javascript but failing to load text on text boxes.
asp.net combo box:-
<asp:DropDownList ID="cmbRole" runat="server" Width="200px" onclientclick="javascript:setValues();">
<asp:ListItem Selected="True" Value="None">-Select-</asp:ListItem>
<asp:ListItem Value="R1">R1</asp:ListItem>
<asp:ListItem Value="R2">R2</asp:ListItem>
<asp:ListItem Value="Other">Other</asp:ListItem>
</asp:DropDownList>
Javascript Function:-
function setValues() {
if (val == "R1") {
var textBox = document.getElementById("txtProduction");
textBox.value = "50";
}
if (val == "R2") {
var textBox = document.getElementById("txtProduction");
textBox.value = 30;
}
}
Kindly help. Thanks in advance.
Regards.