I have a brand list with about 2000 items, my problem is I want to generate a list of commands In jquery using this format dynamically.
$("select[name='brand']").change(function () {
$("#brand1,#brand2").hide();
if ($(this).val() == "brand1") { $("#brand1").show(); }
else if ($(this).val() == "brand2") { $("#brand2").show(); }
and so on...
});
the list of brands is located in MySQL which I brought into an array called
allBrands[] in php
so if the brands update in the MySQL, it will also update in the jquery script.
Obviously I can manually type in each brand, but i'm worried about when I update the database for newer brands etc..
Edit: that being said, if I can do a MySQL call in jquery and get the list of brands that way, that would also work. Brand1, brand2 = examples, names are random based on brand