Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8736093
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:13:32+00:00 2026-06-13T10:13:32+00:00

I’m trying to have functionality where you can click on the, MAKE IT MY

  • 0

I’m trying to have functionality where you can click on the, “MAKE IT MY STORE,” link and it saves the content of the li based on the id and will pull the content of the li onto another page.

This code:

<li><xsl:attribute name="id">store-<xsl:value-of select="@id"/></xsl:attribute></li>

outputs to

<li id="store-1075"></li> 

and the number 1075 represented by, “@id,” changes based on each store location and there are multiple locations.

The li in this section auto-generates any store locations added in the backend. So on the frontend it currently displays more than one list item store location.

<ul id="storeList">
    <xsl:for-each select="$currentPage/* [@isDoc]">
      <xsl:sort select="@nodeName" order="ascending" />
        <li>
          <xsl:attribute name="id">store-<xsl:value-of select="@id"/></xsl:attribute>

            <a href="{umbraco.library:NiceUrl(@id)}">
                <img class="location-image" alt="">
                    <xsl:attribute name="src">
                        <xsl:value-of select="storeImage"/>
                    </xsl:attribute>
                </img>
            </a>

           <a href="{umbraco.library:NiceUrl(@id)}">
              <xsl:value-of select="location"/>
            </a>

            <p><xsl:value-of select="./address"/></p>
            <p><xsl:value-of select="./addressCity"/></p>

            <div class="makeMyStoreWrapper"><a class="makeMyStore" href="#"><xsl:attribute name="id">store-<xsl:value-of select="@id"/></xsl:attribute>MAKE IT MY STORE</a></div>

        </li>
    </xsl:for-each>
</ul>

Right now I have it setup to save the state of the, ul id=”storeList” when clicked using localStorage.setItem. And then any time the id of #storeList appears in the code it will pull in whatever value was saved to localStorage as seen below:

$(function() {

var save = $('#storeList').get(0);

$(save).click(function() {
localStorage.setItem('saved', this.innerHTML);

});


if ( localStorage.getItem('saved') ) {
save.innerHTML = localStorage.getItem('saved');

}

Obviously this is not what I want it to do. Instead I want it to save the content of each individual li clicked. I want the code to be something like this:

var id = any of the store ids or the specific ids, whatever works better.
var save = document.getElementById('store'+id);

or maybe var id equals an array of all the possible store id numbers.

The main purpose is a store locator page where you can click on one or more of the stores and save them to your, “My Store,” page. I almost have it working but I’ve hit a wall. Any help would be awesome and let me know if there is anything I need to clarify. I don’t ever work with ASP so this is tricky for me and this is my first time doing any jQuery or javascript from scratch. I originally tried using it with cookies but decided to use localStorage instead since there is no user login.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:13:33+00:00Added an answer on June 13, 2026 at 10:13 am

    I just finished a similar type project, hopefully this will get you in the right direction

    Inside the document ready function:

    $('.store').on('click', function () { // something with the class store clicked
        var storeStorageKey = $(this).attr('id'); // store id of the item 
    
            $(this).data('value', 1); // use of html5 data values on the html line helped alot, just settin static right now
     //set in local storage so refreshing the page remembers what youve clicked
            localStorage.setItem(storeStorageKey, $(this).data('value'));
     });
    

    Now you can have a collection you can access via store ids, although it might be better to store the entire local storage value as a JSON object to iterate thru, whichever you prefer

    Heres a link to my project javascript that used local storage if you would like reference https://github.com/Jrizzi1/ND-mSummit-bingo/blob/master/js/script.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a small JavaScript validation script that validates inputs based on Regex. I
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have just tried to save a simple *.rtf file with some websites and
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.