修复课程留言重复提交问题

This commit is contained in:
huang 2015-12-11 09:42:19 +08:00
parent 670df76c70
commit 1ba0dae3c4
2 changed files with 16 additions and 4 deletions

View File

@ -27,14 +27,14 @@
</div>
<% else %>
<div nhname='new_message_' style="display:none;">
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'},:method => "post") do |f|%>
<%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_course_message'}, :html=>{:id => "course_feedback_new"},:method => "post") do |f|%>
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
<p nhname='contentmsg_'></p>
<div nhname='toolbar_container_' style="float:left;padding-top:3px;margin-bottom: 15px;"></div>
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
<a id="new_message_submit_btn_" href="javascript:void(0)" class="blue_btn fr ml10 mt10">留言</a>
<% end%>
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="submit_message" >留言</a>
<% end %>
</div>
<% end %>
</div>
@ -50,7 +50,11 @@
<div style="display:none;"><a href="#" id="nhjump"></a></div>
<script type="text/javascript">
$(function(){
$(function(){
$("#submit_message").one('click',function() {
$("#course_feedback_new").submit();
});
KindEditor.ready(function(K){
$("a[nhname='reply_btn']").live('click',function(){
var params = {};
@ -83,4 +87,5 @@
});
});
});
</script>

View File

@ -1363,3 +1363,10 @@ $(function(){
personalized_init();
});
function submit_course_feedback() {
var flag = false;
if(flag == false){
$("#course_feedback_new").submit();
var flag = true
}
}