<% Html.Obout(new ComboBox("ComboBox1") { EmptyText = "Select a customer ...", }); %> <% Html.Obout(new OboutCheckBox("OboutCheckBox1") { Text = "Get Selected Item", OnClientClick = "return getSelectedItem();" }); %>
@Html.Obout(new ComboBox("ComboBox1") { EmptyText = "Select a customer ...", }) @Html.Obout(new OboutCheckBox("OboutCheckBox1") { Text = "Get Selected Item", OnClientClick = "return getSelectedItem();" })
function getSelectedItem() { if (ComboBox1.selectedIndex() != -1) { alert('Selected item: ' + ComboBox1.options[ComboBox1.selectedIndex()].text); } else { alert('No selected item.'); } return false; }