课程留言的回复防止多次提交
This commit is contained in:
parent
979598f334
commit
402976cf40
|
@ -36,7 +36,7 @@
|
|||
<textarea placeholder="有问题或有建议,请直接给我留言吧!" nhname='new_message_textarea_' name="new_form[course_message]"></textarea>
|
||||
<p nhname='contentmsg_'></p>
|
||||
<a id="new_message_cancel_btn_" href="javascript:void(0)" class="grey_btn fr mt10">取消</a>
|
||||
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="submit_feedback_course" >留言</a>
|
||||
<a href="javascript:void(0);" class="blue_btn fr ml10 mt10" id="new_message_submit_btn_" >留言</a>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -55,9 +55,6 @@
|
|||
<script type="text/javascript">
|
||||
|
||||
$(function(){
|
||||
$("#submit_feedback_course").one('click',function() {
|
||||
$("#course_feedback_new").submit();
|
||||
});
|
||||
KindEditor.ready(function(K){
|
||||
$("a[nhname='reply_btn']").live('click',function(){
|
||||
var params = {};
|
||||
|
@ -68,6 +65,7 @@
|
|||
params.textarea = $("textarea[name='user_notes']",params.div_form);
|
||||
params.contentmsg = $("p[nhname='contentmsg']",params.div_form);
|
||||
params.toolbar_container = $("div[nhname='toolbar_container']",params.div_form);
|
||||
params.submit_btn = $("input[nhname='submit_btn']",params.div_form);
|
||||
params.cancel_btn = $("input[nhname='cancel_btn']",params.div_form);
|
||||
params.height = 55;
|
||||
if(params.textarea.data('init') == undefined){
|
||||
|
@ -76,6 +74,9 @@
|
|||
params.cancel_btn.click(function(){
|
||||
nh_reset_form(params);
|
||||
});
|
||||
params.submit_btn.one('click', function () {
|
||||
params.form.submit();
|
||||
});
|
||||
}
|
||||
params.cancel_btn.click();
|
||||
toggleAndSettingWordsVal(params.div_form, params.textarea);
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
|
||||
|
||||
<div class="fl" style="padding-top:5px;" nhname="toolbar_container"></div>
|
||||
<%= submit_tag l(:button_feedback_respond), :name => nil ,
|
||||
<input nhname="submit_btn" type="button" class="reply_btn" value="<%=l(:button_feedback_respond) %>"/>
|
||||
<%#= submit_tag l(:button_feedback_respond), :name => nil ,
|
||||
:class => "reply_btn"%>
|
||||
<input nhname="cancel_btn" type="button" style="display:none;"/>
|
||||
<% end %>
|
|
@ -49,6 +49,9 @@ function nh_check_field(params){
|
|||
if(params.content.isEmpty()){
|
||||
params.contentmsg.html('内容不能为空');
|
||||
params.contentmsg.css({color:'#ff0000'});
|
||||
params.submit_btn.one('click', function(){
|
||||
params.form.submit();
|
||||
});
|
||||
}else{
|
||||
params.contentmsg.html('填写正确');
|
||||
params.contentmsg.css({color:'#008000'});
|
||||
|
@ -68,7 +71,9 @@ function init_form(params){
|
|||
issubmit:true,
|
||||
content:params.editor,
|
||||
contentmsg:params.contentmsg,
|
||||
textarea:params.textarea
|
||||
textarea:params.textarea,
|
||||
submit_btn:params.submit_btn,
|
||||
form:params.form
|
||||
});
|
||||
if(is_checked){
|
||||
if(flag){
|
||||
|
@ -115,7 +120,7 @@ function init_KindEditor_data(id){
|
|||
params.cancel_btn.click(function () {
|
||||
nh_reset_form(params);
|
||||
});
|
||||
params.submit_btn.click(function () {
|
||||
params.submit_btn.one('click', function () {
|
||||
params.form.submit();
|
||||
});
|
||||
params.textarea.data('init', 1);
|
||||
|
|
Loading…
Reference in New Issue