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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:18:02+00:00 2026-06-13T14:18:02+00:00

I have a multiple select as below. It allows me to select options as

  • 0

I have a multiple select as below.

enter image description here

It allows me to select options as below. Assume that 3 sports are selected.

enter image description here

When the items are select as shown above form submit is successful.

But unfortunately if the sports are not selected like below when the form is submitted post is empty.

enter image description here

Select box

<select style="width: 100px; height: 80px;" class="input" id="selected_sport_list" name="selected_sport_list[]" multiple="">
<option value="2">sport 2</option>
<option value="3">sport 3</option>
<option value="5">sport test x</option></select>

How can I make sure that when the form is submitted particular items are selected? Is it possible to use jquery to fix this ? or how?

Thanks

  • 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-13T14:18:03+00:00Added an answer on June 13, 2026 at 2:18 pm

    The problem here is that the browser will not submit the values from each select box unless the user has “checked” them first. This is standard behavior and you will have to address the problem using JavaScript.

    What you need to do is make sure that when the form is submitted, the HTTP request includes the values present inside each select box. You can do this in two ways:

    1. Manually construct part of the submitted data and forward it to the server — e.g. by including it as part of the query string or passing a populated data object to some jQuery AJAX method, or
    2. Dynamically add/remove hidden input elements to the form to match the select box state, so that when the form is submitted these input elements contain the required information (in this case you should be careful to cover the case where the user does select some options too; you don’t want double entries!)

    The first option involves intercepting the form submission and submitting your own modified request through JavaScript.

    The second option involves adding and removing elements to the form and can be implemented either eagerly (intercepting the transfer of elements between the select boxes and immediately mirroring the state using hidden elements) or lazily (intercepting the form submission and injecting the hidden elements on the fly).

    Since at this point we don’t have all the information at hand, you should try to pick one approach from the above and provide some of the relevant code you have written.

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

Sidebar

Related Questions

I have a select field in a form that allows you to select multiple
I have a select options form fields setup like below: <select name=options[] multiple=multiple> <option
i have a form that has a multiple select drop down. a user can
Looking for a UI element implementation that allows to select multiple items out of
I have a macro that allows a user to browse and select multiple Excel
I have multiple tables that need to be merged into one. SELECT name, SUM(money)
I have a multiple select field designed as below: <select name=deductions[] multiple=multiple> <option>Option 1</option>
I have a javascript function below to move from select multiple box A which
I have a T-SQL that works below: SELECT WP_VTDID AS UTIL_VTDID, (SELECT COUNT(WP_ENGINE) FROM
I have multiple Select statements on my page and the options are all the

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.