Populate a combo box

Hi,
I am struggling with this problem: in a page there are 2 combo box:
category and subcategory. When I select a category the subcategory combo
must update its values.

I would like to use JQuery with Ajax to load subcategory after category
change.

It important the page works also without Javascript, Do you have some
idea to accomplish that ?

thank you !
Alessandro

Ale Ds wrote:

Hi,
I am struggling with this problem: in a page there are 2 combo box:
category and subcategory. When I select a category the subcategory combo
must update its values.

I’m assuming you mean list boxes here. Comboboxes are slightly
different.

I would like to use JQuery with Ajax to load subcategory after category
change.

observe_field should do it.

It important the page works also without Javascript, Do you have some
idea to accomplish that ?

Yes. You’ll need to submit the form after the category is chosen if
you’re doing without JS. There’s no other way.

thank you !
Alessandro

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

I would like to use JQuery with Ajax to load subcategory after category
change.

observe_field should do it.

I know that observe_field is a PrototypeHelper methods,
I am using Jquery, then is it better to use only JQuery methods ?

Bye,
Alessandro

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs