dev_aliyun
杨树明 5 years ago
parent a8ebde3ce6
commit 7f8a4dbe87

@ -23,6 +23,7 @@
<%= f.text_field :author_name, placeholder: '请输入姓名', class: 'greyInput winput-300-35 mr20 fl winput150', width: '163', size: 30 %> <%= f.text_field :author_name, placeholder: '请输入姓名', class: 'greyInput winput-300-35 mr20 fl winput150', width: '163', size: 30 %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="author_name_notice">请输入姓名</span></p> <p style="height:20px;line-height:20px;"><span class="color-red none" id="author_name_notice">请输入姓名</span></p>
</li> </li>
<span class="color-red" id="title_author_name">字数不能超过10个字</span>
<li class="fl"> <li class="fl">
<%= f.text_field :author_school_name, placeholder: '请输入作者单位名称', class: 'greyInput winput-300-35 mr20 fl', width: '163', size: 30 %> <%= f.text_field :author_school_name, placeholder: '请输入作者单位名称', class: 'greyInput winput-300-35 mr20 fl', width: '163', size: 30 %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="author_school_name_notice">请输入作者单位名称</span></p> <p style="height:20px;line-height:20px;"><span class="color-red none" id="author_school_name_notice">请输入作者单位名称</span></p>
@ -151,13 +152,13 @@
$("#title_notice").addClass("none"); $("#title_notice").addClass("none");
} }
if (!title || title.length >10) { // if (!title || title.length >10) {
$("#title_notice").removeClass("none"); // $("#title_notice").removeClass("none");
$("#title_notice").html("字数不能超过10个字"); // $("#title_notice").html("字数不能超过10个字");
return // return
}else{ // }else{
$("#title_notice").addClass("none"); // $("#title_notice").addClass("none");
} // }
if (!content || content.length == 0) { if (!content || content.length == 0) {
@ -166,13 +167,24 @@
}else{ }else{
$("#des_notice").addClass("none"); $("#des_notice").addClass("none");
} }
if (!author_name || author_name.length == 0) { if (!author_name || author_name.length == 0) {
$("#author_name_notice").removeClass("none"); $("#author_name_notice").removeClass("none");
return return
}else{ }else{
$("#author_name_notice").addClass("none"); $("#author_name_notice").addClass("none");
} }
if (!author_school_name || author_school_name.length == 0) {
if (!author_name || author_name.length >10) {
$("#title_author_name").removeClass("none");
return
}else{
$("#title_author_name").addClass("none");
}
if (!author_school_name || author_school_name.length == 0) {
$("#author_school_name_notice").removeClass("none"); $("#author_school_name_notice").removeClass("none");
return return
}else{ }else{

Loading…
Cancel
Save