课程问答区帖子的发送防止连续提交

cxt_course
cxt 9 years ago
parent 17497cd74e
commit 979598f334

@ -2,6 +2,7 @@
<%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <%= import_ke(enable_at: true, prettify: false, init_activity: false) %>
<% end %> <% end %>
<script type="text/javascript"> <script type="text/javascript">
var first_click = true;
function nh_check_field(params){ function nh_check_field(params){
var result=true; var result=true;
if(!regexTopicSubject()) { if(!regexTopicSubject()) {
@ -49,10 +50,12 @@
contentmsg:params.contentmsg, contentmsg:params.contentmsg,
textarea:params.textarea textarea:params.textarea
}); });
if(is_checked){ if(first_click && is_checked){
if(flag){ if(flag){
first_click = false;
return true; return true;
}else{ }else{
first_click = false;
$(this)[0].submit(); $(this)[0].submit();
return false; return false;
} }

Loading…
Cancel
Save