Hi,
While retrieving the value of dropdownlist I am getting 'undefined'. here is my code:
@(Html.Telerik().DropDownList()
.Name("cmbInvoieNo")
.BindTo(new SelectList(Model.PIModel, "InvoiceID", "InvoiceName"))
.Placeholder("Select Invoice Number...")
.HtmlAttributes(new { style = "width: 230px; float: left;" })
)
<div><button type="submit" class="t-button t-state-default" onclick="getInvoiceNo()"> @Model.ButtonCaption</button> </div>
----------------------------------------------------------------------------------------------
@{
<script type="text/javascript">
function getInvoiceNo() {
var cmbInvoice = $("#cmbInvoieNo").data("tDropDownList").text();
alert(" Invoice1 : " + cmbInvoice);
}
</script>
}
--- On Click of 'Submit' button : $("#cmbInvoieNo").data("tDropDownList").text() return 'undefined'
$("#cmbInvoieNo") --- 'defined'
$("#cmbInvoieNo").data("tDropDownList") ------- undefined
any Idea what could be wrong ??
While retrieving the value of dropdownlist I am getting 'undefined'. here is my code:
@(Html.Telerik().DropDownList()
.Name("cmbInvoieNo")
.BindTo(new SelectList(Model.PIModel, "InvoiceID", "InvoiceName"))
.Placeholder("Select Invoice Number...")
.HtmlAttributes(new { style = "width: 230px; float: left;" })
)
<div><button type="submit" class="t-button t-state-default" onclick="getInvoiceNo()"> @Model.ButtonCaption</button> </div>
----------------------------------------------------------------------------------------------
@{
<script type="text/javascript">
function getInvoiceNo() {
var cmbInvoice = $("#cmbInvoieNo").data("tDropDownList").text();
alert(" Invoice1 : " + cmbInvoice);
}
</script>
}
--- On Click of 'Submit' button : $("#cmbInvoieNo").data("tDropDownList").text() return 'undefined'
$("#cmbInvoieNo") --- 'defined'
$("#cmbInvoieNo").data("tDropDownList") ------- undefined
any Idea what could be wrong ??