How to get the value from selected text by select combobox?
Here is the aspx.cs code for bind combobox
service.BindHTMLDropdownList(cmb_labelno, "tbl_StockRunning", "StockTagNo", "StockId", "where IsActive = 1 and StockTypePrefix = 'T' and " +
"BranchId = " + Session["BranchId"] + "");
Combobox Name : cmb_labelno
Table Name : tbl_StockRunning
Text : StockTagNo
Value : StockId
Here is the aspx code
<select id="cmb_labelno" runat="server"></select>
<input type="button" id="btnGetStock" value="VIEW"/>
$("#btnGetStock").click(function (e) {
alert(document.getElementById('cmb_labelno').value);
});
Now, the place of alert(document.getElementById(‘cmb_labelno’).value I used
alert(document.getElementById(‘cmb_labelno’).val also still value is not showing.
While the same thing if I am doing in Jquery still showing the selectedtext only not value
Here is my Jquery code,
document.getElementById('<%= cmb_labelno.ClientID %>').value
Is there any problem in code…???