新增题目时,增加标题不能为空的js验证
This commit is contained in:
parent
b71d714103
commit
108435f933
|
@ -34,7 +34,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">
|
||||
<a class="btn btn_dark btn_submit" data-button="ok" onclick="add_poll_question($(this));">
|
||||
<%= l(:label_button_ok)%>
|
||||
</a>
|
||||
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
</ul>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn btn_dark btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">
|
||||
<a class="btn btn_dark btn_submit" data-button="ok" onclick="add_poll_question($(this));">
|
||||
<%= l(:label_button_ok)%>
|
||||
</a>
|
||||
<a class="btn btn_light btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<!--<label>高 <input name="rows" type="number" min="1" value="5"> 行</label>-->
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">
|
||||
<a class="btn_submit" data-button="ok" onclick="add_poll_question($(this));">
|
||||
<%= l(:label_button_ok)%>
|
||||
</a>
|
||||
<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<label for="ur_question_require">必答</label>
|
||||
</div>
|
||||
<div class="ur_editor_footer">
|
||||
<a class="btn_submit" data-button="ok" onclick="$(this).parent().parent().parent().submit();">
|
||||
<a class="btn_submit" data-button="ok" onclick="add_poll_question($(this));">
|
||||
<%= l(:label_button_ok)%>
|
||||
</a>
|
||||
<a class="btn_cancel" data-button="cancel" onclick="$(this).parent().parent().parent().remove();">
|
||||
|
|
|
@ -23,6 +23,14 @@
|
|||
$("#new_poll_question").html("<%= escape_javascript(render :partial => 'new_mulit') %>");
|
||||
$("#poll_questions_title").focus();
|
||||
}
|
||||
|
||||
//确定按钮
|
||||
function add_poll_question(obj)
|
||||
{
|
||||
var title = $.trim($("#poll_questions_title").val());
|
||||
if(title.length == 0){alert("标题不能为空");}else{doc.parent().parent().parent().submit();}
|
||||
}
|
||||
|
||||
//问卷头
|
||||
function pollsCancel(){$("#polls_head_edit").hide();$("#polls_head_show").show();}
|
||||
function pollsSubmit(doc){
|
||||
|
|
Loading…
Reference in New Issue