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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:14:55+00:00 2026-05-28T07:14:55+00:00

I have trouble getting a form element value into a jstl tag. I am

  • 0

I have trouble getting a form element value into a jstl tag. I am doing some fancy stuff in my jsp page, like I have a dropdown menu, once some value is chose, I load the rest of form and once that is chose I load rest, so for first dropdown I have no issues, because they are constants and I know what to load next, but the second drop down menu I have, has dynamic data from server, so I need to know what user selected, so I can load rest of form based on that.

I cant access that form element value in my jstl. how can I do that ?

my jsp:

<head>
<script type="text/javascript">
$(document).ready(function(){
    $("#implementation").change(function(){
        if ($(this).val() == "aaa" ) {
            $("#aaa").slideDown("fast");
        } else {
            $("#aaa").slideUp("fast");
        }
    });

    $("#type").change(function(){
        if ($(this).val() == "new" || $(this).val() == "old") {
            $("#remote").slideDown("fast");
        } else {
            $("#remote").slideUp("fast");
        }
    });
});
</script>
</head>
<body>
    <form:form id="form" name="form" method="post" modelAttribute="store" action="/shard">
    <fieldset>
    <div class="input select">
        <label for="implementation">Implementation<span class="small">Choose implementation</span></label>
        <form:select name="implementation" path="implementation">
            <form:option value="">Choose Implementation</form:option>
            <c:forEach items="${implementations.keySet()}" var="impl">
                <form:option value="${impl}"><c:out value="${impl}" /></form:option>
            </c:forEach>
        </form:select>
    </div>
    <div style="display: none;" id="aaa">
        <div class="input select">
        <label for="aaa" >aaa<span class="small">Choose cluster</span></label>
        <form:select id="cluster" name="cluster" path="cluster">
            <form:option value="">Choose Cluster</form:option>
            <c:forEach items="${implementations.get('aaa').getClusters().keySet()}" var="cl">
                <form:option value="${cl}"><c:out value="${cl}" /></form:option>
            </c:forEach>
        </form:select>
        <label >new</label>
        <form:checkbox id="type" path="type" value="new" /> 
        <label >old</label>
        <form:checkbox id="type" path="type" value="old" />
        <div style="display: none;" id="remote">
            <label>Remote Sites <span class="small">Available Sites</span></label>
            <c:if test="${implementations.get('aaa').getClusters().get(**<I need the above selected type checkbox value>**) == 'new'}">
                <form:checkboxes items="${implementations.get('aaa').getRemoteSites().get('<I need the above selected type checkbox value>').get**<old | new from the type checkbox above>**Sites()}" path="remoteSites" id="remoteSites" style="display: block; float: right;" />
            </c:if>                                 </div>
            <input style="margin-left: 150px; width: 125px; height: 30px;" class="button" type="submit" value="Add" />
         <div class="spacer"></div>
        </div>
     </div>
   </fieldset>
</form:form>
</body>

any help ?

Thank you

  • 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-28T07:14:55+00:00Added an answer on May 28, 2026 at 7:14 am

    Well, the “dynamic” values are likely somehow connected to a dataset or set of pages, so you should have an idea of the return value(s) you need to get. Even if you didn’t you should be able to create some logic to fetch the selected data(s) based on user options.

    Say for instance I have a dropdown list with selection values based on a primary key(s) from a database table. Once the option is selected, I simply fetch the associated data set from the database based on the primary key value in the dropdown. The values from the dropdown may be dynamic, based on previously selected options, but they are still tied to a specific dataset.

    This can all be accomplished through wildcards or some custom logic to parse your select options server-side.

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

Sidebar

Related Questions

I am having trouble getting the page to work. I have my form method
I have trouble getting a flash message to show after a failed form submit.
I am having trouble getting the Auth component redirect. I have a login form
I'm having trouble getting django's django.contrib.localflavor.au.forms to validate my form input. I have tried
I'm pretty new to rails, and I have some trouble getting the philosophy and
Im having some trouble getting on with my first codeigniter project, and i have
I am having some trouble getting a button clicked after submitting a form using
I'm having some trouble getting the following page to display properly in IE 7.
I'm having trouble getting a td to have some text at its top and
i'm having trouble getting the date to be imported into mysql from my form.

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.