Make autocomplete more clear #198
authorCharles Connell <charles@connells.org>
Sun, 22 Dec 2013 22:23:34 +0000 (17:23 -0500)
committerCharles Connell <charles@connells.org>
Sun, 22 Dec 2013 22:23:34 +0000 (17:23 -0500)
karmaworld/assets/js/add-course.js
karmaworld/templates/partial/add_course.html

index f00567098fb418a98f2de052ccc89a266695a656..bec4290b9220004acb2b7bec65c501abb227eedd 100644 (file)
@@ -19,29 +19,24 @@ $(function() {
     }
   }
 
-  // Set up the "Add Course" button at bottom
-  // of page
-  $('#add-course-btn').click(function() {
+  addCourse = function() {
     // Show the add a course form
     $('#add-course-form').show();
     // Hide the add a course button
     $('#add-course-btn').hide();
+    // Scroll the user's page to here
+    $('#add-course-divider').ScrollTo();
     // Put focus in first input field
     $('#str_school').focus();
-  });
+  };
+
+  // Set up the "Add Course" button at bottom
+  // of page
+  $('#add-course-btn').click(addCourse);
 
   // Set up the "Add Course" button in the
   // page header
-  $('#add_course_header_button').click(function() {
-    // Show the add a course form
-    $('#add-course-form').show();
-    // Hide the add a course button
-    $('#add-course-btn').hide();
-    // Scroll the user's page to here
-    $('#add-course-divider').ScrollTo();
-    // Put focus in first input field
-    $('#str_school').focus();
-  });
+  $('#add_course_header_button').click(addCourse);
 
   // Dismiss on exit x click FIXME
   $(".lightbox_close").click(function() {
index 590f35682f77077d15d1bd01d123ad55afd46ee6..07e37a7c2f94b067850ae103a6fb202346432ff7 100644 (file)
           School
          {% if course_form.school.errors %}
           <span style="color:red">
-          * there was an error with this field
+            Please select a school from the drop-down
           </span>
          {% endif %}
         </legend>
         <div>
-          <input id="str_school" class="" type="text" name="str_school"/>
+          <input id="str_school" class="" type="text" name="str_school" placeholder="Select a school"/>
           <input id="id_school" name="school" type='hidden'/>
         </div>
       </div>