classic asp - dropdown to select all dropdowns with the same value as the first dropdown

1.8k Views Asked by At

I have a primary drop down list that has three values: 1 - select 2 - Fail 3 - pass

the page is populated from the database, so here you could have anything from 1 to 50 dropdown to set the status of each record as fail or pass.

I would like to select 'fail' from the primary dropdown, any dropdown's that are populated from database should set to the selection i have made as being 'fail'

hope someone can help. thank you Yas

1

There are 1 best solutions below

10
Siva Charan On

You can do this using javascript or jquery.

OnChange of first dropdown, select all dropdown values accordingly.

EDIT:

For your reference, I have prepared an example. Refer LIVE DEMO

HTML:

<select class="dDown">
    <option value="select">select</option>
    <option value="Pass">Pass</option>
    <option value="Fail">Fail</option>
</select>
<select>
    <option value="select">select</option>
    <option value="Pass">Pass</option>
    <option value="Fail">Fail</option>
</select>
<select>
    <option value="select">select</option>
    <option value="Pass">Pass</option>
    <option value="Fail">Fail</option>
</select>
​

JS:

$('.dDown').on("change", function() {
    $('select').not('.dDown').val(this.value);
});​