Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Dropdown menu events..

  • 18-06-2009 7:18pm
    #1
    Registered Users, Registered Users 2 Posts: 2,234 ✭✭✭


    Hi,

    I'm lookin to have a dropdown menu that has a list of peoples names. When a name is selected.. ajax kicks in and queries a DB to get the details of the user. Those details are printed into another text box..

    Basically: How can I tell the browser to call a function when one of the items has been selected.. something like onClick for a button but that doesn't work?

    I'm rushing out now but if I haven't explained my problem very well i'll post examples later...

    Thanks..


Comments

  • Closed Accounts Posts: 7,145 ✭✭✭DonkeyStyle \o/


    Uh, onchange works for dropdowns AFAICR.
    But take your pick here -> http://www.w3schools.com/jsref/jsref_events.asp


  • Registered Users, Registered Users 2 Posts: 2,234 ✭✭✭techguy


    Uh, onchange works for dropdowns AFAICR.
    But take your pick here -> http://www.w3schools.com/jsref/jsref_events.asp

    Perfect, thanks!!


  • Closed Accounts Posts: 18,163 ✭✭✭✭Liam Byrne


    Forgive me if I'm a little confused by the fact that someone who doesn't know about onchange is considering using AJAX......


  • Registered Users, Registered Users 2 Posts: 2,234 ✭✭✭techguy


    Liam Byrne wrote: »
    Forgive me if I'm a little confused by the fact that someone who doesn't know about onchange is considering using AJAX......

    Don't be confused! My knowledge on Javascript and DOM are really non existent. I literally grabbed a tutorial online that pulled some info from one another php page and put it in a text box when you typed something into antoher text box.

    I mainly use PHP but i'm going to try and learn the basics of ajax/js so i'll have enough to get me over the line.

    I know general javascript but I suppose it's using DOM to control elements of the page is where I fall down. This is probably where I should start..


Advertisement