0
每當AJAX調用的頁面應該被重新加載,但形式各領域不應該獲得的頁面加載如何使用清除表單域重新加載ajax調用頁面?
我的形式清除
<form method='post'>
<input type='text' placeholder='product'/>
<input type='number' placeholder='cost'/>
<input type='number' placeholder='tax'/>
<button type='button' id="cust_tax" data-toggle="collapse" data-target="#cust_tax">Custom tax</button>
<input type='number' placeholder='new tax' id="cust_tax" class="collapse"/>
<input type='button' class='apply_tax'>New tax add</button>
<input type='submit'/>
</form>
在自定義的稅收用戶點擊有一個Ajax調用將new_tax保存在數據庫中,並自動添加到列表中。
我的AJAX
$(".tax_apply").click(function() {
var tax_name = document.getElementById("tax_name").value;
var tax_value = document.getElementById("tax_value").value;
ajaxPost('/myurl',{'user':user,'tax_name':tax_name,'tax_value':tax_value},function(result){
alert('new tax added');
//reload page
});
});
現在每當AJAX調用和用戶添加新的稅種,應該重新加載,他已經進入不應該得到清除
爲什麼_it應該重新加載page_? – Rayon
由於一些支持問題無法解決 –
我認爲你應該發佈/詢問/解決這個問題,而不是問這個補丁! – Rayon