参与问卷答题,提交弹框点击确定时,总是提示如下“确认导航”弹框,容易让用户误解

This commit is contained in:
cxt 2017-01-20 15:00:46 +08:00
parent 28f0f1edad
commit 532db3dec9
3 changed files with 24 additions and 17 deletions

View File

@ -1,9 +1,7 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'commit_alert',:locals => {:status => @status}) %>');
showModal('ajax-modal', '270px');
$('#ajax-modal').css('height','110px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='hidden_atert_form();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().removeClass("alert_praise");
$('#ajax-modal').parent().css("top","").css("left","").css("border","3px solid #269ac9");
$('#ajax-modal').parent().addClass("alert_box");
<% if @status == 0 %>
notice_box_redirect("<%= poll_index_path(:polls_group_id => @course.id,:polls_type => 'Course') %>", "提交成功!");
<% elsif @status == 1 %>
notice_box("您还有尚未作答的必答题目请完成后再提交!");
<% else %>
notice_box("发生未知错误,请检查您的网络。");
<% end %>

View File

@ -337,7 +337,8 @@
<% end %>
<% end %>
if(!result){
alert("您的多选题答题不符合要求,请检查后再提交");
notice_box("您的多选题答题不符合要求,请检查后再提交");
//alert("");
}
return result;
}

View File

@ -614,13 +614,13 @@ function warnLeavingUnsaved(message) {
$(this).data('changed', 'changed');
});
window.onbeforeunload = function(){
var warn = false;
$('textarea').blur().each(function(){
if ($(this).data('changed')) {
warn = true;
}
});
if (warn) {return warnLeavingUnsavedMessage;}
// var warn = false;
// $('textarea').blur().each(function(){
// if ($(this).data('changed')) {
// warn = true;
// }
// });
// if (warn) {return warnLeavingUnsavedMessage;}
};
}
@ -1773,6 +1773,14 @@ function notice_box(str){
pop_box_new(htmlvalue, 300, 140);
}
//提示框:只有一个确定按钮,点击跳转
function notice_box_redirect(url, str){
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear mt15"><p class="text_c f14">' + str + '</p><div class="cl"></div>'+
'<a href="'+ url +'" class="fr sy_btn_blue mt10 mr10" style="margin-right: 124px;">确定</a></div></div>';
pop_box_new(htmlvalue, 300, 140);
}
//删除组织成员
function ifDeleteOrgMember(id,name){
var htmlvalue = "</br><div style='width:550px;text-align:center'>您确定要删除"+name+"吗?</div></br><div style='width:164px; margin:0 auto; text-align:center'><a href='javascript:void(0);' class='Blue-btn fl' onclick='deleteOrgMember("+id+")'>确定</a><a href='javascript:void(0);' class='Blue-btn fl' onclick='hideModal()'>取消</a></div>" +