From 747fb84ef644a126064f19c7c24416ae1aef9144 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Fri, 5 Dec 2014 16:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E3=80=8A=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E6=94=B9=E5=88=86=E7=BB=84=E5=90=8D=E3=80=8B?= =?UTF-8?q?bug=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/_groups_name.html.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index 2a53e2780..9a57d1127 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -12,15 +12,15 @@ } } function validate_update(name) { - value1 = document.getElementsByName(name)[0].value; + value1 = document.getElementById(name).value; validate_groupname(value1); - document.getElementsByName(name)[0].value = ""; + } function validate_add_group() { - value1 = document.getElementsByName("group_name")[0].value; + value1 = document.getElementById('group_name').value; validate_groupname(value1); validate_groupname_null(value1); - document.getElementsByName('group_name')[0].value = ""; + } @@ -54,7 +54,7 @@
  • <%= form_tag(updategroupname_course_path(@course,:group_id => group.id), method: 'get', remote:true, update: 'group_name') do %>