I have a global select box on the page that I want to use to set all of the other select boxes on the page. They all have the same options in them.
So when I change the global drop down, how do I set all of the other ones to the same value.
All of my other select boxes have an id that starts with "inventory_location_select_"
$("#global_location").change(function(){ var globalValue = $("#global_location").val(); $("input[id^=inventory_location_select_]").val(globalValue); }); Here is my html:
Main Select Box:
<select id="global_location"> <option selected="selected">Choose Option</option> <option value="3542">Acme Pos 1</option> <option value="3545">Acme Pos 2</option> <option value="4892">Acme Test 1234567890</option> <option value="4896">FBA CA Prep</option> <option value="4889">FBA Prep 1</option> <option value="4895">FBA Prep 2</option> <option value="4897">FBA Prep 3</option> <option value="4893">POD 3 Area 1</option> </select> One of my other boxes:
<select id="inventory_location_select_1"> <option>Choose Option</option> <option value="3542">Acme Pos 1</option> <option value="3545">Acme Pos 2</option> <option value="4892">Acme Test 1234567890</option> <option value="4896">FBA CA Prep</option> <option value="4889">FBA Prep 1</option> <option value="4895">FBA Prep 2</option> <option value="4897">FBA Prep 3</option> <option value="4893">POD 3 Area 1</option> </select> This seems so easy, I just cant figure it out.