|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
The code for selection box is:
<select name="select" size=1 > <option value="0" selected><b>CATEGORIES</b></option> <option value="">USERS</option> <option value="">ROOMS</option> .... </select> I would like to know that when the USER option is selected from the selection box, how do i call a javascript function eg: userframe(). I have certain commands in the function userframe() to execute after the selection is made from the box. Thanks Yashika |
|
#2
|
|||
|
|||
|
hi,
If i understand correctly, you want to have a function called whenever the user clicks on a particular option? You can do this by writing an OnChange handler, and then checking which option is selected. Something kind of like: <SELECT name="mybox" Size=10 OnChange="CheckClick()";> ... and then the handler: function CheckClick() { // where 3 is the index of your USER option if(document.UserForm.mybox.options[3].selected) [do something, like call UserFunction()] else [return, or do something else] } -stef [This message has been edited by sgromoll (edited 12-21-99).] |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > CODE FOR SELECTION |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|