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 @@