Hi,
I have a problem with js code I am using for selectmenus.
On my screen I have a grid with collapsible block with selectmenus in the blockcontent I am using the following code to populate 2 lables through selectmenu and localstorage. All works fine
codevar curent_order = $(this).find("option:selected").text();
localStorage.setItem("curent_order", curent_order);
$(this).closest("[name=mealdeal1mobilegrid]").find("[dsid=selectmeu1label]").text(localStorage.getItem("curent_order"));
var curent_item = $(this).find("option:selected").val();
localStorage.setItem("curent_item", curent_item);
$(this).closest("[name=mealdeal1mobilegrid]").find("[dsid=selectmeu1deslabel]").text(localStorage.getItem("curent_item"));/code
I added another grid to the screen with collapsible block and selectmenus
all component have different to those in the first grid, from a different collection I ran a get service, and added the following code to populate these labels from this new selectmenu, same as before just adjusted for component and variable names.
when I add the code to this different select this code is over writing the code for the select menu in the first grid.
Dont understand how they are connected as all component have different names
I hope this makes sense, if not please ask.
codevar deal2item = $(this).find("option:selected").text();
localStorage.setItem("deal2item", deal2item);
$(this).closest("[name=mealdeal2mobilegrid]").find("[dsid=deal2selectmenu1label]").text(localStorage.getItem("deal2item"));
var item2descript = $(this).find("option:selected").val();
localStorage.setItem("item2descript", item2descript);
$(this).closest("[name=mealdeal2mobilegrid]").find("[dsid=deal2selectmenudes1label]").text(localStorage.getItem("item2descript"));/code
thx