修改《添加,修改分组名》bug

Signed-off-by: alan <547533434@qq.com>
This commit is contained in:
alan 2014-12-05 16:33:55 +08:00
parent c5a7baa454
commit 747fb84ef6
1 changed files with 5 additions and 5 deletions

View File

@ -12,15 +12,15 @@
} }
} }
function validate_update(name) { function validate_update(name) {
value1 = document.getElementsByName(name)[0].value; value1 = document.getElementById(name).value;
validate_groupname(value1); validate_groupname(value1);
document.getElementsByName(name)[0].value = "";
} }
function validate_add_group() { function validate_add_group() {
value1 = document.getElementsByName("group_name")[0].value; value1 = document.getElementById('group_name').value;
validate_groupname(value1); validate_groupname(value1);
validate_groupname_null(value1); validate_groupname_null(value1);
document.getElementsByName('group_name')[0].value = "";
} }
</script> </script>
@ -54,7 +54,7 @@
<li> <li>
<%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %> <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %>
<span id="add_tag_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l"> <span id="add_tag_<%= group.id %>" style="display:none; vertical-align: middle;" class=" f_l">
<%= text_field_tag "group_name", params[:group_name],:name => "group_name#{group.id}", :size=>10, :class=>"isTxt w90 f_l", :style=>"padding: 0px", :max => 20 %> <%= text_field_tag "group_name#{group.id}", params[:group_name],:name => "group_name", :size=>10, :class=>"isTxt w90 f_l", :style=>"padding: 0px", :max => 20 %>
<!--<input type="button" class="submit f_l" onclick="addTag();" style="width: 43px"/>--> <!--<input type="button" class="submit f_l" onclick="addTag();" style="width: 43px"/>-->
<%= submit_tag '', class: "submit f_l", :onclick => "validate_update('group_name#{group.id}')", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %> <%= submit_tag '', class: "submit f_l", :onclick => "validate_update('group_name#{group.id}')", style: "width: 43px;height: 21px;background: url(/images/btn.png) no-repeat 0 0;" %>
</span> </span>