Ahmed Ali
Ahmed Ali

Reputation: 1007

Onchange event for html drop-down list

i am trying to control a set of drop-down menus,by changing the first menu then all the others will have the first menu selected item as selected.

In my example,what i want to achieve is : when changing the selected value of the 'select for All' then the rest should be set to that value.

i hope i made it clear.

thanks in advance.

Check the below screenshot:enter image description here

Upvotes: 0

Views: 3012

Answers (2)

Markipe
Markipe

Reputation: 606

UPDATED!!!! Try this link DEMO

 $("#sortedby").change(function () {
      $("select").val($(this).val());
  });

UPDATED!!!!

Upvotes: 2

landons
landons

Reputation: 9547

Here's an example of a jQuery implementation (change your selectors accordingly):

$(function() {
    $('select.select-all').change(function() {
        $('select', $(this).closest('tr')).val(this.value);
    });
});

Upvotes: 1

Related Questions