doPost and select menu's

Posted on 2004-10-26
Last Modified: 2013-11-24
I have a java servlet that i post a form to. On the form, I have a select menu (non-multiple).

How do i access all of the options that are in that select menu? The request object only contains the currently selected option.

Any help/suggestions/comments would be greatly appreciated.


Question by:michaelmwilson1
    LVL 8

    Accepted Solution

    you need to use javascript to append all the options to the URL(if you dont want to store the options in the session or in a bean). The browser always sends only the selected options.
    LVL 86

    Expert Comment

    >>How do i access all of the options that are in that select menu?

    Why would you want to if only one is selected?
    LVL 92

    Assisted Solution

    > How do i access all of the options that are in that select menu?

    You cannot access them from the request, but as you created the menu in the first place you should already know them.
    If you are using JSP, you could store the menu options in your session when you create it.
    LVL 8

    Expert Comment

    did you find any of the suggestions useful?? havent heard from you for a long time

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
    This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

    846 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now