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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:20:18+00:00 2026-06-16T00:20:18+00:00

I have a tr like this in my jsp. <tr id = fromDate style=display:none;>

  • 0

I have a tr like this in my jsp.

<tr id = "fromDate" style="display:none;">

I also have a select like this.

    <select id="select2" name="dateRange1" 
               onChange="javascript:chooseDate(this.value);">
    <option value="0" <c:if test='${dateRange == 0}'> 
            selected </c:if>>Select a Date</option>

The javascript function used in the select is as below.

function chooseDate(val) {
        if (val == "0") { 
            document.getElementById("fromDate").style.display='';
            }
        else 
        {
            document.getElementById("fromDate").style.display='none';
        }
    }

So if the selected row is not 0, i wont be displaying the tr in the page. This is working fine.
I set the dateRange variable in request.setAttribute() and sending it from action.
The problem is the option is selected properly from the request value, but the tr is not shown
I tried running it like this outside the form in jsp, hoping that it will get executed before the page load, but didn’t happen.

<script language="javascript">
   chooseDate(${dateRange});
</script>

Any thoughts?

  • 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-16T00:20:19+00:00Added an answer on June 16, 2026 at 12:20 am

    Try this!

    <script language="javascript">
       window.onload = function() {
          chooseDate(${dateRange});
       }
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a date input field in my jsp like this: <form:input name=inputDate id=inputDate
I have a form like this - <form method='post' name='FormName' action=next.jsp> <INPUT TYPE=hidden NAME=language
I have a simple HTML form like this: <form name='input' action='thankyou.jsp' method='post'> <p>Email Address:
I want to have a JSP like this: <form id=form1> Name is: <%=request.getParameter(name) %>
Hi I have something like this in struts.xml <action name=LoginAction class=controller.LoginAction> <result name=error>/Error.jsp</result> <result
I have something like this in HTML: <select name=selection> <option id=1>First Option</option> ... </select>
I have a JSP page at an address like this: http://example.com/foo/bar/rawr/something.jsp When I output
I have a custom jsp tag like this: <a:customtag> The body of the custom
I have a jsp code like this <html:option value=${apealstaList.appealStatusMasterId} disabled=true>${apealstaList.appealStatusDescription}</html:option> This disable the options
I have set my error page like this in web.xml: <error-page> <exception-type>java.lang.Exception</exception-type> <location>/errors/error.jsp</location> </error-page>

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.