我有两个文本框
<div>@Html.TextBoxFor(model=>model.Voyage_ID, new{id="VID"})<br /></div>
<div>@Html.EditorFor(model=>model.Arrived, new { @id = "arrived",})</div>
第一个是根据下拉列表的选定索引从json动态更新的。以同样的方式,我希望显示与在VID中捕获的id相关联的第二个字段(以及更多其他字段)。
我该如何做到这一点?
答案 0 :(得分:0)
您可以使用jQuery .change()方法:
$(document).ready(function(){
$('#VID').change(function(){
var currentValue = $(this).val(); //get current value of the input
//here comes your logic
});
})