Hi, I'm new to javascript and jquery. I was looking to use $(selector).bind() instead of using the ONCHANGE handler inline. Could some one help me out on how to use that in the following code.
- <Script language="JavaScript">
- function goto(form) { var index=form.select.selectedIndex
- if (form.select.options[index].value != "0") {
- location=form.select.options[index].value;}}
- </script>
- <div id="select_student">
- <br />
- <br />
- <h2>Choose a Student:</h2>
- <form id="student_select" method="post">
- <select id="select" name="select" ONCHANGE="goto(this.form)" SIZE="1">
- <option selected="selected">---Select a Student---</option>
- <?php
-
- foreach ($students as $s) {
-
- echo ('<option name="student_choice" value="https://secure.freteleven.com/lesson/get_student_lesson/'.$s->userid.'">'.$s->first_name.' '.$s->last_name.'</option>');
-
- }
- ?>
-
- </select>
- </form>
- <br />
- <br />
- </div>