1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| {# 选择配送地址 #} $('#select').change(function () { var a = $('#select option:selected'); if (a.val() !== "") { $('input[type="text"]').attr('readonly','readonly'); $($('input[type="text"]')[0]).val(a.attr('name')); $($('input[type="text"]')[1]).val(a.attr('address')); $($('input[type="text"]')[2]).val(a.attr('post_code')); $($('input[type="text"]')[3]).val(a.attr('addr_mobile')); $($('input[type="text"]')[4]).val(a.attr('cell_phone')); }else { $('input[type="text"]').attr('readonly',''); for (var i=0; i < $('input[type="text"]').size();i++) { $($('input[type="text"]')[i]).val("") } } })
|