socialforge/app/views/users/_apply_homework.html.erb

28 lines
1.3 KiB
Plaintext

<div>
<div class="ni_con">
<%= form_tag(apply_for_homework_user_path(:id=>User.current.id,:homework_id=>homework.id), :multipart => true,:remote => true,:name=>"apply_for_homework_form",:id=>'apply_for_homework_form') do %>
<h2>申请分享</h2>
<p style="color: #000;">
申请说明(必选):
<textarea type="text" name="content" id="apply_content" placeholder="请附言,以增加分享的成功机率。" class="apply_content mt10" style="outline:none;"></textarea>
</p>
<span class="c_red ml5 f12" style="display: none" id="apply_content_notice">为增加分享的成功机率,请务必填写申请说明。</span>
<div class="ni_btn">
<a href="javascript:" class="tijiao" onclick="submit_apply_homework();" style="margin-bottom: 20px; margin-left: 60px; color: #fff">
确&nbsp;&nbsp;定
</a>
</div>
<% end %>
</div>
</div>
<script type="application/javascript">
var first_click_apply = true;
function submit_apply_homework(){
if($.trim($("#apply_content").val()) == ""){
$("#apply_content_notice").show();
} else if(first_click_apply) {
first_click_apply = false;
$('#apply_for_homework_form').submit();
}
}
</script>