课程留言 重复提交问题

This commit is contained in:
lizanle 2015-12-18 18:09:20 +08:00
parent a1d0bf43ee
commit a657a5b98d
1 changed files with 17 additions and 3 deletions

View File

@ -1,4 +1,4 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= form_tag(words_create_reply_path, :remote => true,:id=>"form_#{journal.id}") do %>
<%= text_area_tag 'user_notes', "", :class => 'w520 h50 mb5',
:style => "resize: none;overflow: hidden;",:rows => 4,
:placeholder => l(:label_feedback_respond_content)#,
@ -13,6 +13,20 @@
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
<%= submit_tag l(:button_feedback_respond), :name => nil ,
:class => "reply_btn"%>
:class => "reply_btn" ,:onclick=>"form_sub_#{ journal.id}($(this),event)"%>
<input nhname="cancel_btn" type="button" style="display:none;"/>
<% end %>
<% end %>
<script>
var flag_<%= journal.id %> = false;
function form_sub_<%= journal.id%>(dom,event){
if(flag_<%= journal.id %> == true){
//dom.attr('disabled','disabled');
return;
}else{
//dom.removeAttr('disabled');
}
flag_<%= journal.id %> = true;
$("#form_<%= journal.id%>").submit();
event.preventDefault();
}
</script>