回复帖子要点两次提交问题

This commit is contained in:
z9hang 2014-10-21 16:34:46 +08:00
parent 38345c0c68
commit 164297e30f
1 changed files with 5 additions and 4 deletions

View File

@ -178,7 +178,7 @@
<%= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= render :partial => 'form', :locals => {:f => f, :replying => true} %>
<%#= submit_tag l(:button_submit) %>
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onclick="submit_message_replay();" >
<input type="button" class="enterprise" value="<%=l(:button_submit) %>" onmousemove="regexContent()" onclick="submit_message_replay();" >
<%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %>
<% end %>
<div id="preview" class="wiki"></div>
@ -188,12 +188,13 @@
<% html_title @topic.subject %>
<script type="text/javascript">
var flag = false
jQuery(document).ready(function($) {
transpotUrl('#content');
});
function submit_message_replay()
{
if(regexContent())
if(flag)
{
$("#message-form").submit();
}
@ -205,13 +206,13 @@
{
$("#message_content_span").text("<%= l(:label_reply_empty) %>");
$("#message_content_span").css('color','#ff0000');
return false;
flag = false;
}
else
{
$("#message_content_span").text("<%= l(:label_field_correct) %>");
$("#message_content_span").css('color','#008000');
return true;
flag = true;
}
}
</script>