-1
我有checkbox哪個onchange調用一個函數並執行一些操作。在函數結束時,我得到2個值。我需要將這些值發送到提交表單的服務器上。我怎樣才能做到這一點??Onchange的複選框調用函數,獲取返回值,然後提交表格
myjsp
<script>
function fnsimplecalc(){
//some calculations...
var w1=/*some value*/;
var w2=/*some value*/;
}
</script>
<form name="test" id= "testid" action="Controller" method="post" >
<input type="checkbox" id="checkid" onchange="fnsimplecalc()">
</form>
我需要的形式提交到服務器後,我從fnsimplecalc()函數獲取值。我該怎麼做呢?
搜索「jquery post」 – VtoCorleone
添加您嘗試過的內容。 – j809
我已經添加了我所做的。不知道如何傳遞值。 – user123