0

我有两个文本框

<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 相关联的第二个字段(以及更多其他字段)。

我怎样才能做到这一点?

4

1 回答 1

0

您可以使用jQuery .change()方法:

$(document).ready(function(){
    $('#VID').change(function(){
       var currentValue = $(this).val(); //get current value of the input
       //here comes your logic
    });
})
于 2015-01-06T17:34:44.833 回答