elclanrs / jq-idealforms-old

The ultimate framework for building and validating responsive HTML5 forms.
665 stars 95 forks source link

Populate a selectbox on a .change event of another selectbox #28

Closed hoekie closed 12 years ago

hoekie commented 12 years ago

Hi elclanrs,

I try to populate a selectbox on a .change event of another selectbox:

$box1 = $("select[name='box1']"); // Selectbox 1 $box2 = $("select[name='box2']"); // Selectbox 2

$box1.change(function() { $("select[name='box2'] option").remove(); $('').appendTo($box2); $('').appendTo($box2); });

This works fine with 'normal' select boxes but box1 will not populate in idealforms.

But...

When I click on box2 after I clicked on box1 (after populate), the 'required' filter returns ok so there must be a value selected.

I hope you can help.

Thanks!

Richard Hoek

hoekie commented 12 years ago

Argh...maby I had to read the open issues first. This issue already exists at #10... :(

elclanrs commented 12 years ago

Still on my TODO list. The code for the select menu is getting a bit bloated due to poor planning, so this will require some refactoring...This feature as well as a custom multiselect are on the way soon...

hoekie commented 12 years ago

Thanks! A custom multiselect would be very nice! I solved this temporary by using the addFields / removeFields property.