【发布时间】:2017-07-24 06:03:42
【问题描述】:
在easyui中创建新用户时如何禁用多次单击保存按钮,同时将请求发送到php以将其插入数据库中
function saveUser() {
$('#fm').form('submit', {
url: url,
onSubmit: function() {
return $(this).form('validate');
},
success: function(result) {
if (result === 'exists') {
$.messager.alert('Alert', 'Name already exists!\nPlease enter different Name', 'info');
$('#fm').form('clear');
} else {
$('#dlg').dialog('close'); // close the dialog
$('#dg').datagrid('reload'); // reload the user data
}
}
});
}
直到响应没有从 php 文件到达,我不希望发送另一个请求。
【问题讨论】:
-
放置你的用户界面代码
-
你已经尝试了什么?一种(公平地说可能不是最干净的)解决方案可能是在单击按钮时禁用按钮,获取响应,启用按钮,返回/显示它。
标签: javascript php jquery jquery-easyui