newbie
|
| Posted: 04/23/2002, 8:06 AM |
|
i have a table student which contains studentid and studentname.i have another table which is attendance.i need to update the student attendance so i need to key in the studentid and studentname..right now i need to select the studentid in the listbox and the studentname automatically appears in my studentname listbox/textbox/whatever...how do i do that?can anyone pls help???any help will be appreciated!
|
|
|
 |
Nicole
|
| Posted: 04/24/2002, 12:40 AM |
|
Hello,
it could be done with JavaScript. Create JS function that catch selected value (lets say student name) from ListBox and put it to textbox. Assign function to onchange event of Listbox.
Here is sample code:
<script language = "JavaScript">
document.FormName.student_listbox.onchange = set_val;
function set_val()
{
var set_f = document.FormName.student_textbox_field;
var get_f = document.FormName.student_listbox;
set_f.value = get_f.options[get_f.selectedIndex].text
}
</script>
|
|
|
 |
|