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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T21:54:46+00:00 2026-06-03T21:54:46+00:00

i have a drop box with static values and i i have made a

  • 0

i have a drop box with static values and i i have made a EDIT.jsp page now which will show the values i stored in the database and i want them to be shown in a drop list as a default value consider there are 4 elements

    <select name="language">
  <option value="1">c++</option>
  <option value="2">php</option>
  <option value="3">.net</option>
  <option value="4">java</option>

i want if the value in the database table is 3 then when the page loads the default value should be as shown in the drop list be

     <select name="language">
  <option value="3">.net</option>
  <option value="1">c++</option>
  <option value="2">php</option>
  <option value="4">java</option>

and i can’t use jquery in this…i want a solution preferably in java
i tried using value attribute and javascript but it sis nt work…i am new to java so i could nt figute out how to pass java scriplets in javascript if they r possible…i am making a Online examination system for my 2nd year engineering project

please help!!

  • 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-03T21:54:48+00:00Added an answer on June 3, 2026 at 9:54 pm

    You have to use selected attribute of option tag.

    get the value which is stored in the database and, put them in select box

    <c:if test={1 is selected}>
        <option value = "1" selected="selected">c++</option>
    </c:if>
    
    <c:if test={2 is selected}>
        <option value = "2" selected="selected">java</option>
    </c:if>
    
    <c:if test={3 is selected}>
        <option value = "3" selected="selected">php</option>
    </c:if>
    
    <c:if test={4 is selected}>
        <option value = "4" selected="selected">.net</option>
    </c:if>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic drop down box which calls another PHP page. I've got
I have a drop box which is populated by information from a database. Some
I have a drop down box with values dynamically populated from a database. So,
I have reframed my Question: I have a drop down box which is populated
I have a drop-down list box and two text fields of id values namely
I want to have multiple drop box with around three on the page at
I have a drop down box with yes and no values. By default it's
I am trying to populate a drop-down box which I have created in the
I have a drop down box for each row inside a table <table> <tr>
I have a drop down box and some text input fields below it. Based

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.