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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:31:15+00:00 2026-06-15T18:31:15+00:00

I have a page with a check box so that when its checked, it

  • 0

I have a page with a check box so that when its checked, it will submit values and parameters via GET, this is how it looks like by default:

Passing two product SKUs:

http://example.com/product-comparisons/?product-skus=1&product-skus=2

Passing only one product SKUs:

http://example.com/product-comparisons/?product-skus=1

OR this:

http://example.com/product-comparisons/?product-skus=2

What I want to accomplish is to change the GET parameter ONLY when passing two or more products such as this:

http://example.com/product-comparisons/?product-skus=1&product-skus=2

INTO THIS:

http://example.com/product-comparisons/?product-skus=1,2

And when there are no checked products but the form is submitted, it will change the URL from:

http://example.com/product-comparisons/

INTO THIS:

http://example.com/product-comparisons/?product-skus=0

that is adding 0 to the product-skus query string variable.

I already have a jQuery code that will run when the submit button is clicked:

jQuery( document ).ready( function( $ ) {
$('#myform').submit( function() {

    //change the GET URL parameters


 });

});

But I’m stuck with the rest of the process. I would like this to happen when submitting the form. I would be glad if someone can provide some sample code to get started. Thank you so much.

  • 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-15T18:31:16+00:00Added an answer on June 15, 2026 at 6:31 pm

    I’m going to offer a suggestion that doesn’t directly answer your question, but which will probably solve your problem, and may save you a lot of work and headache in the process.

    I assume you want to modify the GET params because your server-side application is only receiving one of the values when many are passed, and you want to split the comma-delimited param to solve your problem.

    There’s an easier alternative.

    Change your checkbox name attribute to product_skus[], and when you read it on your server-side app, it will be retrieved as an array.

    e.g.:

    http://example.com/product-comparisons/?product-skus[]=1&product-skus[]=2
    

    If you’re reading this in PHP:

    print_r($_GET['product_skus']);`
    

    Will give you:

    Array(0 => '1', 1 => '2')
    

    Hope that helps you out!

    (PS – You can do this with other server-side languages, too, like Python, and I’m sure most other modern languages. Java and .NET can do it without the [] syntax, so I’m pretty sure you’re not using those.)

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

Sidebar

Related Questions

I have a web page that consists of a checkbox (parent) and on this
Hello everyone I have a checkbox I want to check if its checked or
I have an aspx page that contains a checkbox, and a button. The button
We have an ASP.Net page that uses a checkbox to toggle between a list
i have a signup page and i want to check username exists or not
In the header of my page I have a conditional statement to check if
I have a HTML page, with html-mode enabled. I call function sgml-validate to check
I have an image upload page (single page). When submitted it check filesize and
How can I check whether all JavaScript functions have loaded properly on a page?
I have a javascript page which checks an email and username, this works fine

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.