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

  • Home
  • SEARCH
  • 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 8096171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T21:22:07+00:00 2026-06-05T21:22:07+00:00

I want to know how to read the DropDown list value from the JSP.

  • 0

I want to know how to read the DropDown list value from the JSP. Below is the code of my JSP.

   <fieldset>
   <s:form theme="simple" enctype="multipart/form-data"  name="uploadDocument" method="POST" action="?">
   <table>
   <tr>
   <td wrap>Select The Type of Letter to Upload:</td><td><s:select id="letters" list="letterList" name="ListofLetters" headerKey="-1" headerValue="--Select The Letter Type--"/></td>
    <tr>
    <td nowrap ><s:file name="userFile" label="userFile" size="25" id="upload" /></td>
    <td  class="button-blue"><s:submit action="Upload" value="Attach File" onclick=" return validateFile()"/></td>
    </tr>
    </table>
    </s:form>
    </fieldset> 

where the list is populated dynamically from the Database.I wanted to know how to get the Dropdownlist value not the key.
Because when i used

document.getElementById('letters').value

It returns me the keyvalue like “0,1,2 etc” how can i get the value associated with the individual key so i can perform the proper check.
Thanks in Advance 🙂

  • 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-05T21:22:08+00:00Added an answer on June 5, 2026 at 9:22 pm

    Use this to get the currently selected option’s text:

    var sel = document.getElementById('letters');
    var selText = sel.options[sel.selectedIndex].text;
    

    Fiddle

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

Sidebar

Related Questions

Just want to know how to read an attribute of a parent node from
I want to know if it is possible to read from a text file
I want to know how to read a number from a file to a
i want to know how can i read from file in java until the
I read filter and exclude from django documentation but I want to know that
I juste want to know how to read the value status in this PHP
I want to know how can I read attachment messages without using scriplets in
I want to know if there is any provision that allows me to read
I've read this question, but I want to know how can I delete the
I don't want the message to count as read but I'd like to know

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.