function checkDirect() { var category = $('select[name=product_category]').val(); var brand = $('select[name=product_brand]').val(); // if (((category == 'Bags') || (category == 'Wallets')) && (brand == 'Louis Vuitton')) { // $('#direct-purchase').show(); // } else { // $('#direct-purchase').hide(); // $('#direct-purchase input').prop('checked', false); // } } function checkBrand() { var category = $('select[name=product_category]').val(); $('select[name=product_brand] option').removeAttr('selected'); switch(category){ case "" : var options_product_brand = []; break; case "Bags" : var options_product_brand = [ "Alexander McQueen", "Balenciaga", "Bottega Veneta", "Burberry", "Celine", "Chanel", "Chloe", "Coach", "Dior", "Dolce & Gabbana", "Faure Le Page", "Fendi", "Furla", "Givenchy", "Goyard", "Gucci", "Hermes", "Issey Miyake", "Jacquemus", "Kate Spade", "Lanvin", "Loewe", "Longchamp", "Louis Vuitton", "Loup Noir", "Marc Jacobs", "MCM", "Michael Kors", "Miu Miu", "Mulberry", "Phillip Lim", "Polene", "Prada", "Proenza Schouler", "Rimowa", "Salvatore Ferragamo", "Stella McCartney", "Tod's", "Tory Burch", "Valentino", "Victoria Beckham", "Yves Saint Laurent", ]; break; case "Belt" : var options_product_brand = [ "Dior", "Gucci", "Hermes", "Louis Vuitton", "Salvatore Ferragamo", ]; break; case "Jewelry" : var options_product_brand = [ "Balenciaga", "Bvlgari", "Cartier", "Celine", "Chanel", "Hermes", "Louis Vuitton", "Marni", "Tiffany & Co.", ]; break; case "Shoes" : var options_product_brand = [ "Alexander McQueen", "Balenciaga", "Bottega Veneta", "Burberry", "Celine", "Chanel", "Chiara Ferragni", "Chloe", "Christian Louboutin", "Coach", "Dolce & Gabbana", "Fendi", "Givenchy", "Gucci", "Hermes", "Kenzo", "Lanvin", "Loewe", "Louis Vuitton", "Malone Souliers", "Manolo Blahnik", "Marc Jacobs", "Michael Kors", "Miu Miu", "Prada", "Roger Vivier", "Salvatore Ferragamo", "Stella McCartney", "Tod's", "Tory Burch", "Valentino", "Yves Saint Laurent", ]; break; case "Sunglasses" : var options_product_brand = [ "Chanel", "Dior", "Dolce & Gabbana", "Miu Miu", "Prada", ]; break; case "Wallets" : var options_product_brand = [ "Alexander McQueen", "Balenciaga", "Bottega Veneta", "Burberry", "Celine", "Chanel", "Chloe", "Coach", "Dior", "Dolce & Gabbana", "Faure Le Page", "Fendi", "Givenchy", "Goyard", "Gucci", "Hermes", "Kate Spade", "Lanvin", "Loewe", "Longchamp", "Louis Vuitton", "Marc Jacobs", "Michael Kors", "Miu Miu", "Mulberry", "Phillip Lim", "Prada", "Proenza Schouler", "Salvatore Ferragamo", "Stella McCartney", "Tod's", "Tory Burch", "Valentino", "Victoria Beckham", "Yves Saint Laurent", ]; break; case "Watches" : var options_product_brand = [ "Gucci", "Hermes", "Louis Vuitton", ]; break; default: var options_product_brand = []; } var select_product_brand = document.getElementById("product_brand"); $('#product_brand').empty(); var el = document.createElement("option"); el.textContent = "-- Pilih Salah Satu --"; el.value = ""; select_product_brand.appendChild(el); for(var i = 0; i < options_product_brand.length; i++) { var opt = options_product_brand[i]; var el = document.createElement("option"); el.textContent = opt; el.value = opt; select_product_brand.appendChild(el); } checkDirect(); } checkBrand();