diff --git a/app/views/contests/_new_softapplication.html.erb b/app/views/contests/_new_softapplication.html.erb index 3e4c0c9e0..fb16e9351 100644 --- a/app/views/contests/_new_softapplication.html.erb +++ b/app/views/contests/_new_softapplication.html.erb @@ -4,7 +4,7 @@ //验证作品名称 function regexName() { - var name = $("#softapplication_name").val(); + var name = $.trim($("#softapplication_name").val()); if(name.length == 0) { $("#spane_name_notice").text("<%= l(:label_no_softapplication_name) %>"); @@ -31,7 +31,7 @@ //验证作品简介 function regexDescription() { - var name = $("#softapplication_description").val(); + var name = $.trim($("#softapplication_description").val()); if(name.length ==0) { $("#span_sofapplication_description").text("<%= l(:label_no_softapplication_description) %>"); @@ -56,7 +56,7 @@ //验证运行平台 function regexWorkdescription() { - var workDescription = $("#softapplication_android_min_version_available").val(); + var workDescription = $.trim($("#softapplication_android_min_version_available").val()); if(workDescription.length ==0) { $("#spane_workdescription_notice").text("<%= l(:label_no_softapplication_platform) %>"); @@ -80,7 +80,7 @@ //验证开发人员 function regexDevelopers() { - var workDescription = $("#softapplication_application_developers").val(); + var workDescription = $.trim($("#softapplication_application_developers").val()); if(workDescription.length ==0) { $("#span_softapplication_application_developers").text("<%= l(:label_no_softapplication_developers) %>"); diff --git a/app/views/messages/_course_show.html.erb b/app/views/messages/_course_show.html.erb index 41f2e4736..51764341d 100644 --- a/app/views/messages/_course_show.html.erb +++ b/app/views/messages/_course_show.html.erb @@ -177,7 +177,8 @@ <%= 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) %> + <%#= submit_tag l(:button_submit) %> + <%#= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') %> <% end %>
@@ -190,9 +191,27 @@ jQuery(document).ready(function($) { transpotUrl('#content'); }); -// function regexContent() -// { -// var content = trim($("#message_content").val()); -// alert(content); -// } + function submit_message_replay() + { + if(regexContent()) + { + $("#message-form").submit(); + } + } + function regexContent() + { + var content = $.trim($("#message_content").val()); + if(content.length ==0) + { + $("#message_content_span").text("<%= l(:label_reply_empty) %>"); + $("#message_content_span").css('color','#ff0000'); + return false; + } + else + { + $("#message_content_span").text("<%= l(:label_field_correct) %>"); + $("#message_content_span").css('color','#008000'); + return true; + } + } \ No newline at end of file diff --git a/app/views/messages/_form.html.erb b/app/views/messages/_form.html.erb index d906efea9..2cfeea80e 100644 --- a/app/views/messages/_form.html.erb +++ b/app/views/messages/_form.html.erb @@ -42,6 +42,7 @@<%= label_tag "message_content", l(:description_message_content), :class => "hidden-for-sighted" %> <%= f.text_area :content, :cols => 80, :rows => 13, :class => 'wiki-edit', :id => 'message_content', :onblur => "regexContent();" %> +