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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:12:32+00:00 2026-06-11T02:12:32+00:00

I have some different search parameters, which can be dynamical in different categories. My

  • 0

I have some different search parameters, which can be dynamical in different categories. My problem is, that I need to use jquery to check if there is clicked on a check box and then change the URL so that the parameters are inserted.

My HTML for one search parameter box is:

<h3>{heading}</h3>
<div class="{class} {parameter} searchParam" name="class">
    <ul>
        <li><input type="checkbox" name="{name}" value="{value}" />{value}</li>
    </ul>
</div>

Every parameter has “searchParam” as class – the other to parameters are dynamical.

What I need to is for every .searchParam to be created a URL part so that if e.g. 3 search params had checked values (the input in the li), then the URL would be like this:

http://domain.com/param1=value1,value2,value3.param2=value1,value2.param2=value1

Is this possible?

  • 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-11T02:12:34+00:00Added an answer on June 11, 2026 at 2:12 am

    I solved it this way:

    $(document).ready( function() {
            var params = [];
    
            $(".searchParam").click(function(){
                params = [];
                $(".searchParam").each(function(index){
                    var name = $(this).attr('name');
                    var values = $('.'+ name +' input:checkbox:checked').map(function (){ return this.value }).get();
    
                    if(values.length > 0){
                        params.push({'name': name, 'values': values }); 
                    }           
                });
    
                var curUrl = $(location).attr('href');
                var newUrl = curUrl.split('/');
                var urlNumPar = newUrl.length - 1;
    
                var redirectURL = '';
    
                $(newUrl).each(function(index, val){
                    if( index == urlNumPar)
                    {
                    } else {
                        redirectURL += val+"/";
                    }
                });
    
                $(params).each(function(index, val){
                    if(params.length > 1 && index > 0)
                    {
                        redirectURL += ".";
                    }
                    redirectURL += val['name'] + "=" + val['values'];
                });
    
                window.location.href = redirectURL;
            });
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some folder with different files. I want to use something like this:
I have some 10 buttons with different names each.On selecting each button I need
I have some XML files that contain different function information. I am trying to
I have some code in a couple of different functions that looks something like
I have some internal link which shows different content. Everytime I click the internal
I have some data which (quite reasonably) uses null and false for different meanings.
I have some unit tests that expects the 'current time' to be different than
I need to get help with a problem. I have an application, which displays
I have a page which contains some search fields to query a database, and
I want to add some parameters to my URLs so that I can identify

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.