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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:50:44+00:00 2026-05-14T04:50:44+00:00

Client code is pretty simple: <form action=DDServlet method=post> <input type=text name=customerText> <select id=customer> <option

  • 0

Client code is pretty simple:

<form action="DDServlet" method="post">
       <input type="text" name="customerText">
       <select id="customer">
             <option name="customerOption" value="3"> Tom </option>
             <option name="customerOption" value="2"> Harry </option>
       </select>
       <input type="submit" value="send">
</form>

Here is the code on the Servlet

Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()){
      String paramName = (String)paramNames.nextElement();  //get the next element
      System.out.println(paramName);
}

When I print out, I only see, customerText, but not customerOption. Any idea why guys? What I hope is, if I select Tom in my option, once I submit, on my servlet I should able to do this: String paramValues[] = request.getParameterValues(paramName); and get back value of 3

  • 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-14T04:50:45+00:00Added an answer on May 14, 2026 at 4:50 am

    You need to put the name attribute on the select. This should fix it up:

    <select name="customerOption" id="customer">
        <option value="3"> Tom </option>
        <option value="2"> Harry </option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Something pretty peculiar is happening with a simple JS GET client. Here's the code
Say I have a simple client/server scenario with one method: // client code $client
I'm writing a select query in a C# method which lets client code provide
I have a pretty simple client-server ASP.NET app; communication is via WCF service. All
on the server side, I've got these: ASPX: <form id=form1 runat=server enctype=multipart/form-data> <input type=file
For a very simple ajax name lookup, I'm sending an id from the client
This is the snippet of client code: connect(DescrittoreClient, (struct sockaddr *) &serv_addr, sizeof(serv_addr)); strcpy(Buffer,
I have a year's experience writing client code but none with server stuff. I
I put a TCP server and client code in PIC controller. Now just wanted
I have an ASP.NET MVC server app and client code which uses jquery. I'd

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.