#1
  1. No Profile Picture
    yashika
    Guest
    Devshed Newbie (0 - 499 posts)
    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. #2
  3. No Profile Picture
    sgromoll
    Guest
    Devshed Newbie (0 - 499 posts)
    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).]

Similar Threads

  1. UTF-8 decoding error: unexpected code byte
    By rshirah in forum Python Programming
    Replies: 0
    Last Post: August 18th, 2003, 02:34 PM
  2. Giving the code... or not
    By Manso in forum Dev Shed Lounge
    Replies: 5
    Last Post: August 8th, 2003, 04:49 PM
  3. Dreamweaver generated code... inefficient ? Why?
    By sykes in forum PHP Development
    Replies: 4
    Last Post: February 18th, 2003, 02:51 PM
  4. Random code generator
    By quiquedcode in forum PHP Development
    Replies: 2
    Last Post: November 26th, 2002, 11:58 AM
  5. vB code
    By z-lite in forum PHP Development
    Replies: 4
    Last Post: June 23rd, 2001, 05:50 PM

IMN logo majestic logo threadwatch logo seochat tools logo