SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    onchange not working with ajax populated select

    I have a dropdown list that is populated by ajax request....therefore it is empty in the html source. I am trying to fire a js event onchange on this select, but it doesnt seem to be working (no js error though in FF console.

    Is it not possible to do an onchange() on an ajax populated select?

  2. #2
    SitePoint Evangelist
    Join Date
    Jan 2005
    Location
    UK
    Posts
    539
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nevermind...an alert told me it was working....i just didnt have the correct code to change what i wanted!

  3. #3
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do you insert the options? You setting the selects innerHTML? Or are you populating the select using the DOM?

    onchange only triggers in Firefox when the user either:
    • Selects a new option with the mouse
    • Uses the arrow keys to select another options and presses enter

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by skyline View Post
    nevermind...an alert told me it was working....i just didnt have the correct code to change what i wanted!
    ah ok...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •