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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:29:16+00:00 2026-06-13T05:29:16+00:00

I have an HTML form which posts its information to a java servlet. One

  • 0

I have an HTML form which posts its information to a java servlet. One of the sections in the HTML is a multiple checkbox where one of the options is an “all of the above” option.

Mode of Transportation:<br>
<input type="checkbox" name="transport" value="Car" /> Car <br>
<input type="checkbox" name="transport" value="Bike" /> Bike <br>
<input type="checkbox" name="transport" value="Public Transit" /> Public Transit <br>
<input type="checkbox" name="transport" value="All of the Above" /> All of the Above <br>

The java page accepts it into an array:

String[] transport = request.getParameterValues("transport");

And now it’s supposed to just post back the information: How do I account for the “All of the Above” option? Meaning if it’s checked how do I forgo the other checks and list everything?

  • 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-13T05:29:19+00:00Added an answer on June 13, 2026 at 5:29 am

    Two ways:

    Either using javascript, check all the check boxes if All Of the above is selected immediately after select or before posting the form.

    Or handle in the server side i.e. before processing, check, if one of the values is All Of the above then handle it appropriately i.e. populate your user answer list with all options provided.

    You use statement below to check if All Of the above was selected:

    boolean isAllSelected = Arrays.asList(transport).contains("All Of the above");
    
    • 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 simple html login form which is validated with javascript before its
I have a post html form, and the action is index.php, which is the
I have an HTML form which, when submitted by the user, will call a
I have an html form which when it gets submitted it calls a JavaScript
I have a html form which have a select list box from which you
I have a HTML form which allows a user to add rows ad hoc
I have an HTML Contact us form which I plant on my client's HTML
I have a HTML form that has certain fields which i am opening inside
I have a HTML form that accepts a comma separated list of tags, which

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.