我有這種形式可根據所選的第一個下拉值在第二個下拉菜單中更改值。它按設計工作,但僅限於第一次選擇的選項。如果我在下拉菜單中重新選擇一個不同的值(第二次),它不會在下拉菜單中更改值(它只會根據第一個選項更改它)。在這種情況下,如果用戶第一次輸入了錯誤的值,除非重新加載頁面,否則無法更改它。這裏是一個小提琴http://jsfiddle.net/k4hYE/53/從下拉菜單中選擇的選項填充另一個文本框/更改下拉值的值
var objArray = {"On-Call Service": "Per Pickup"};
var objArray = {"Every Six Months (2 Stops Annually)": "Per Pickup"};
var objArray = {"Every Three Months (4 Stops Annually)": "Every Three Months"};
var objArray = {"Every Other Month (6 Stops Annually)": "Every Other Month"};
var objArray = {"Monthly (12-13 Stops Annually)": "Per Month"};
var objArray = {"Every Other Week (26 Stops Annually)": "Per Month"};
var objArray = {"Every Week (52 Stops Annually)": "Per Month"};
$("#00NA00000047Jk8").change(function()
{
var ddText = $(this).val();
$.each(objArray,function(key,value)
{
if(ddText == key)
$("#00NA0000005wIiU").val(value);
});
});
對不起錯了小提琴這裏是正確的鏈接http://jsfiddle.net/k4hYE/54/ – user3498478
如果鏈接是錯誤的問題,只是編輯的問題。 –