function sendValues() {
var str = $("#ryan_m").serialize();
var response = $('input[name=brand[]]:checked').val();
$.ajax({
url: "/trying1.php?avoidcache=' + myTimestamp();",
data: {str}
cache: false
});
}
<form action="trying1.php?b_id=$brand_id" method="get"/></td>
<input type="checkbox" name="brand[]" value="$brand_id"/>
<input type="submit" value="Compare" id="ryan_m" method="get" />
</form>
我想在檢查可用的複選框時使用此Ajax請求執行。 目前,這個腳本將完成我想要的,但我必須點擊提交才能執行。使用jquery選擇器(複選框)執行onClick
我的問題:
有沒有我可以在點擊複選框執行AJAX,沒有擊中提交一份簡單的方法?
你的問題解決了。請選擇一個工作答案作爲解決方案。 – buschtoens 2011-04-03 20:41:32