我有一个带有表单的php页面,我想在对话框中打开它并在不重新加载页面的情况下提交并在同一对话框中显示数据
<form accept-charset="UTF-8">
<button type="submit" class="addButtonClass"></button>
请咨询
答案 0 :(得分:0)
$('.addButtonClass').submit(function (event) {
event.preventDefault();
....
.. Now your usual ajax post
}
答案 1 :(得分:0)
修改此
$('#add_user1').submit(function(e){
e.preventDefault(); //** prevent normal form submission and page reload
$.ajax({
type: "POST",
cache: false,
url: $link,
data: $('#add_user1').serializeArray(),
success: function (data) {
var json_obj = $.parseJSON(data);
var result = json_obj['result'];
var usergroup = json_obj['usergroup'];
var success = json_obj['success'];
var errorAry = {
}
}
});
return false;
});