Problem with an AJAX drop-down menu

Hi everyone,

I’m currently playing with ruby on rails, and I was trying to build a
form with limited AJAX functionalities…

So here is my problem : I want to create a form in order to allow
visitors to choose a car make and a car model. Once the user has choosen
his make in a select tag, the model select tag is supposed to be updated
with the models that belong to the choosen make (using an AJAX
observer).

The problem is that the model menu is updated (i use a partial to fill
the select tag with s), but the html tags are missing, and the
models aren’t selectable, nor are they separated since they’re not
included between and .

I tried to replace the drop-down menu with a simple unordered list
(

    ), updated and filled with
  • tags… and it works. Is there
    something special about form tags?

    Sorry if this isn’t clear, i haven’t practised my English for a while…

    Thanks for your attention,

    foxxbat

You can’t use plain HTML to update a . You have to use
the API of the select element, or you might have luck replacing the
entire
select element (not just the options) with your partial.

So, yes, is special.

-Thomas

Am 27.03.2006 um 19:08 schrieb foxxbat:

Thomas F. wrote:

You can’t use plain HTML to update a . You have to use
the API of the select element, or you might have luck replacing the
entire
select element (not just the options) with your partial.

So, yes, is special.

-Thomas

Am 27.03.2006 um 19:08 schrieb foxxbat:

Thanks a lot for the help. I have the same problem with the select API,
but it seems to work fine if i replace the entire select element.

foxxbat