I have two drop down .on page load I will check the first dropdown value .that value laod from data base on page load if there are no value into data base then assign a value 1. If there are value then got the last value and add 1 in each time. Then these value show in second dropdown .my second dropdown are disable I will code it but cannot assign the value.
I will debug it value got from the first dropdown but problem is that tp assign these value to the second dropdown and show on page load please help me to solve it.
Following my whole html and jquery code.
Following my whole html and jquery code.
Html code
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
<asp:DropDownList ID="DropDownList2" runat="server">
</asp:DropDownList>
My jquery code
$(document).ready(function () {
var checkdata = $('#DropDownList1 option:last-child').text();
if (checkdata == 'Click to Load Bills---->') {
$("#DropDownList2 option[text='1']")
}
var checkdata = $('#DropDownList1 option:last-child').text();
if (checkdata >= 1) {
checkdata = parseInt(checkdata + 1)
$("#DropDownList2 option[value=' checkdata ']")
}
});
Please help me how I assign this value dynamically