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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:55:50+00:00 2026-05-27T12:55:50+00:00

This form has multiple choices through a checkbox. Eg. Pet You Own is a

  • 0

This form has multiple choices through a checkbox. Eg. Pet You Own is a multiple choice and there are various options such as Cat, Dog, Mule etc.

Now by default, the querystring sent will look like:

?pet=dog&pet=cat&pet=mule 

given all 3 are checked.

I need a way to parse this so that the querystring looks like:

?pet=dog,cat,mule

Another requirement is that, there are other parameters/inputs in the form so it needs to work in conjunction with other standard form inputs.

  • 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-05-27T12:55:51+00:00Added an answer on May 27, 2026 at 12:55 pm

    The format you’re currently seeing is the conventional format. If your form fields were named pet[] rather than pet, your server would be able to interpret the result as an array.

    Having said that, to actually do what you’re requesting, you could reset the name attribute of your checkboxes, so that they won’t be posted, and instead post a hidden field that holds the value of your checkboxes as a comma separated string:

    $('#my-form').submit(function() {
    
        var pets = [];
        $('input[name=pet]:checked').each(function() {
            pets.push($(this).val());
        });
    
        // stop checkboxes from being posted
        $('input[name=pet]').attr('name','');
    
        // have an input field be posted instead
        $('#my-hidden-field')
            .val(pets.join(','))
            .attr('name', 'pet');
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this html form which has options: <tr> <td width=30 height=35><font size=3>*List:</td> <td
I have a page with multiple forms on it. Each form has it's own
I have a form, this form has a submit and a cancel button. when
Getting a rendering error for this form: 'NoneType' object has no attribute 'widget' http://dpaste.com/88585/
Form has the DoubleBuffered property (bool, inherited from Control). If this is set to
I'm tweaking a WinForms application. This application has a Form that contains a PropertyGrid
I'm using C# and Process newProcess = Process.Start(someProgram.exe); This someProgram.exe has a form that
Everyone has this huge massively parallelized supercomputer on their desktop in the form of
This piece of valid json (it has been generated using php's json_encode): {html:form is
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to

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.