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 8310843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:36:24+00:00 2026-06-08T19:36:24+00:00

I have an interactive UI of elements, and I was encouraged to use divs

  • 0

I have an interactive UI of elements, and I was encouraged to use divs and spans exclusively, and avoid checkboxes. I have converted the site over to the same functionality, but don’t know much about persistence to begin with, but with checkboxes, it seemed approachable given the idea of being ‘checked’ or ‘not checked’. How would I begin to use this approach with tracking each element’s visibility?

Here is the page I am trying to implement persistence on.

Previous implementation (not my code, as I am new to JS and persistence) used the following:

// Persistence
//¿¿??
var formvals = {};
var keyval = location.search.replace('?', '').split('&');
$.each(keyval, function () {
    var splitval = this.split('=');
    formvals[splitval[0]] = splitval[1];
});

$.each($('form')[0].elements, function () {
    var key = $(this).attr('name');
    if (key && formvals[key]) {
        $('#' + key).val(formvals[key]);
    } else {
        if ($(this).attr('type') == 'checkbox') {
          $('#'+key)[0].checked = false;
        }
    }
});

I would like to know how to use the visibility of the elements to help develop different templates.

I can’t find any intros into URL persistence, and Im not quite sure what the previous code does, so any explanation or guidance is greatly appreciated.

If you need more information, please ask, and hopefully you can help send me down the right path.

  • 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-08T19:36:26+00:00Added an answer on June 8, 2026 at 7:36 pm

    If URL will be like http://site.com/page.html?id_block_to_click1=1&id_block_to_click2=1 it should work

    $(function(){
        var formvals = {};
        var keyval = location.search.replace('?', '').split('&');
    
        $.each(keyval, function () {
            var splitval = this.split('=');
            formvals[splitval[0]] = splitval[1];
        });
    
        $.each(formvals, function(key,val){
            if (val == 1) {
                $('#'+key).click();
            }
        })
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application that contains several transitioning elements. These same elements react to
I have to create a sample silver-light page that has some user interactive elements
I have jquery ui sortables working fine but my sortable elements have other interactive
I have a UserControl containing interactive elements within a grid. The user can move
I have an interactive web application powered by jQuery where users can manipulate visual
I wish to download information from the website http://revigo.irb.hr/ which have an interactive menu.
I have intranet highly user interactive ASP.net applications, which now I am going to
I have been tasked to develop an interactive website using java & mysql: using
I have a custom UIView that contains an interactive drawing that is drawn in
I have a Ruby script (1.8.7) that sets up its own interactive shell for

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.