keeping a value selected in drop down list using javascript

Discussion in 'JavaScript' started by anniejolly, Apr 14, 2010.

  1. #1
    Hi,

    i am sending an ajax call from my cfm page. the ajax call returns an array of values. I need not populate these values accordingly on my html form. In my form i have a drop down list with some values. I need to keep that value selected on the drop down list which was returned by the ajax call?


    thks
     
    anniejolly, Apr 14, 2010 IP
  2. s_ruben

    s_ruben Active Member

    Messages:
    735
    Likes Received:
    26
    Best Answers:
    1
    Trophy Points:
    78
    #2
    Set the IDs of the drop down options like their values and when your ajax call returns the values, set selected="selected" all options of drop down which IDs = returned array values.
     
    s_ruben, Apr 14, 2010 IP