我正在使用jtable作为我的网格,当创建新记录时,它会在那里引发一个弹出窗口。我有一个下拉列表,所以我需要获取该下拉列表的值。我怎样才能做到这一点?
这是html:
<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-draggable ui-resizable" style="display: block; z-index: 1002; outline: 0px none; position: absolute; height: auto; width: auto; top: 78px; left: 828px;" tabindex="-1" role="dialog" aria-labelledby="ui-dialog-title-2">
<div class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 30px; height: auto;" scrolltop="0" scrollleft="0">
<form id="jtable-create-form" class="jtable-dialog-form jtable-create-form" method="POST" action="/Item/Insertar">
<div class="jtable-input-field-container">
<div class="jtable-input-label">Producto</div>
<div class="jtable-input jtable-dropdown-input">
<select id="Edit-Producto" class="" name="Producto">
<option value="1">Burn 1 L</option>
<option value="2">Burn 1.5 L</option>
<option value="3">Burn 1/2 L</option>
</select>
</div>
</div>
</form>
</div>
</div>
$('#Edit-Producto').change(function () {
var t = $('#Edit-Producto').val();
alert(t);
alert('Handler for .change() called.');
});
$("select[name='Producto']").change(function () {
alert('Handler for .change() called.');
});
</script>