0
你好 我已經開發了我的網站的自動提示,它工作正常,現在的問題是,現在的用戶選擇單選按鈕自動提示應該去相應的建議得到單選按鈕的值,然後進行自動提示
$().ready(function() {
$("#q").autocomplete('?h=sugg&a='+$("#rad").val(), {
width:350,
max: 10,
highlight: false,
scroll: true,
scrollHeight: 300,
selectFirst: false,
formatResult: function(data, value) {
return value.split(".")[0];
}
});
<input name="q" id="q" autocomplete="off" />
<input type="radio" name="rad" value="radio" id="rad_0" checked="checked" />
Radio</label>
<br />
<label>
<input type="radio" name="rad" value="radio1" id="rad_1" />
Radio</label>
事情是它總是選擇默認值,如果我選擇其他不改變,請告訴我,我怎麼能做到這一點...