Im trying to find out the image selected, based on the image picked i would then show a div depending on the "band" its in.
I have the below for now but cant seem to get it to work and in particular seems to be failing when trying to get the values from each item any help appreciated:
var _Small = ["product1"];
var _Med = ["product2"];
var _Large = ["product 3"];
jQuery("#btn").click(function(){
//get the image picker ID and see if this returns the selected options
var _selected = jQuery ("select").data("picker").selected_values();
var band = 1;
for(i=0; _selected.length; i++){
//Check if the selected option is in one of the bands and then set the band its in
if (jQuery.inArray(_selected[i],_Small) != -1){
if(band == 1)
band = 1;
}
if (jQuery.inArray(_selected[i],_Med)!= -1){
if(band < 2)
band = 2;
Im trying to find out the image selected, based on the image picked i would then show a div depending on the "band" its in.
I have the below for now but cant seem to get it to work and in particular seems to be failing when trying to get the values from each item any help appreciated:
var _Small = ["product1"]; var _Med = ["product2"]; var _Large = ["product 3"];
jQuery("#btn").click(function(){
//get the image picker ID and see if this returns the selected options var _selected = jQuery ("select").data("picker").selected_values();
var band = 1;
for(i=0; _selected.length; i++){
//Check if the selected option is in one of the bands and then set the band its in if (jQuery.inArray(_selected[i],_Small) != -1){
}
if (jQuery.inArray(_selected[i],_Med)!= -1){ if(band < 2) band = 2;
} if (jQuery.inArray(_selected[i],_Large)!= -1){
} }
if(band == 3){
jQuery("#price3").show(); }
})