Skip to content

Commit

Permalink
优化前端表单提交错误时,不能继续提交数据问题
Browse files Browse the repository at this point in the history
  • Loading branch information
welliamcao committed Mar 21, 2018
1 parent 83225d8 commit 5defbc5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions OpsManage/templates/assets/assets_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -632,6 +632,7 @@ <h4 class="modal-title" id="myRaidModalLabel">
var value = form[i].value;
if ( value.length == 0){
window.wxc.xcConfirm("请注意必填项不能为空~", window.wxc.xcConfirm.typeEnum.error);
btnObj.removeAttr('disabled');
return false;
}
else{
Expand Down Expand Up @@ -676,6 +677,7 @@ <h4 class="modal-title" id="myRaidModalLabel">
post_data[name] = value;
if ( value.length == 0){
window.wxc.xcConfirm("请注意必填项不能为空~", window.wxc.xcConfirm.typeEnum.error);
btnObj.removeAttr('disabled');
return false;
}
else{
Expand Down Expand Up @@ -710,6 +712,7 @@ <h4 class="modal-title" id="myRaidModalLabel">
onOk:function(result){
if (result.length == 0){
/* 如果没有输入字符串则直接退出 */
btnObj.removeAttr('disabled');
return;
};
if (op=="service"){
Expand Down
4 changes: 4 additions & 0 deletions OpsManage/templates/database/db_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,7 @@ <h4 class="modal-title" id="myDatabaseEditModalLabel">
idx = $.inArray(name, required);
if (idx >= 0 && value.length == 0){
window.wxc.xcConfirm("请注意必填项不能为空~", window.wxc.xcConfirm.typeEnum.error);
btnObj.removeAttr('disabled');
return false;
};
if ( value.length != 0 && name.length != 0 ){
Expand Down Expand Up @@ -752,6 +753,7 @@ <h4 class="modal-title" id="myDatabaseEditModalLabel">
idx = $.inArray(name, required);
if (idx >= 0 && value.length == 0){
window.wxc.xcConfirm("请注意必填项不能为空~", window.wxc.xcConfirm.typeEnum.error);
btnObj.removeAttr('disabled');
return false;
};
if ( value.length != 0 && name.length != 0 ){
Expand Down Expand Up @@ -789,6 +791,7 @@ <h4 class="modal-title" id="myDatabaseEditModalLabel">
idx = $.inArray(name, required);
if (idx >= 0 && value.length == 0){
window.wxc.xcConfirm("请注意必填项不能为空~", window.wxc.xcConfirm.typeEnum.error);
btnObj.removeAttr('disabled');
return false;
};
if ( value.length != 0 && name.length != 0 ){
Expand Down Expand Up @@ -826,6 +829,7 @@ <h4 class="modal-title" id="myDatabaseEditModalLabel">
idx = $.inArray(name, required);
if (idx >= 0 && value.length == 0){
window.wxc.xcConfirm("请注意必填项不能为空~", window.wxc.xcConfirm.typeEnum.error);
btnObj.removeAttr('disabled');
return false;
};
if ( value.length != 0 && name.length != 0 ){
Expand Down

0 comments on commit 5defbc5

Please sign in to comment.