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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:36:49+00:00 2026-05-27T17:36:49+00:00

I am working a webproject using struts2 and I used struts2 jquery plugin for

  • 0

I am working a webproject using struts2 and I used struts2 jquery plugin for datepicker.
Now I need to validate ToDate depending on FromDate.
ToDate shouldnot be greater than FromDate

validation should be like this, datepicker should disable the behind dates accodring to fromdate.Then user not able to select lower than the from date

Please let me know how can I implemt this.
Please post the code will help

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-05-27T17:36:49+00:00Added an answer on May 27, 2026 at 5:36 pm

    That’s your choice how you want to impliment the validation.There are 2 ways which as of now seems feasible to me

    1. Client side validation using JavaScript.
    2. Server Side validation in your action class.

    For the first part your both data-picker must have id and name so once user filled ToDate and FromDate and before submitting the form you can call a java-script function where you can fetch the values of respective date-picker fields using java-script document.getEmelemntById() and can run your comparison logic.

    Other option is to let Struts2 fill the ToDate and FromDate values in your action class and you can use validate method inside your Action to perform date validation.choice is all yours.

    You can even play around with validation framework even.

    Update

    After playing around with J query plugin source code here is the workaround we have

     <s:form id="form" theme="xhtml">
        <sj:datepicker id="date12" name="date12" label="With Close Event" onCompleteTopics="onDpClose"/>
        <sj:datepicker id="date13" name="date13" label="With Min and Max Date" minDate="0" maxDate="+2m"/>
        </s:form>
    
       <script type="text/javascript">
            $.subscribe('onDpClose', function(event,data) {
            $('#date13').datepicker( "option" , 'minDate',event.originalEvent.dateText ); 
         });
       </script> 
    

    In similar way can work for other way around.Hope this will work for you.

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

Sidebar

Related Questions

Now I'm working on a web project. I need to create a XML document
Working in Eclipse on a Dynamic Web Project (using Tomcat (v5.5) as the app
I am working on web project. We are using flex as UI layer. My
I've started working on a new web project with some friends... we are using
Using Visual Source Safe with IIS integration (the working dir is the IIS site)
I am working on a web project using Tomcat 6 as my webserver and
I'm using visual studio 2008 SP1, I'm working with a web project in VB.NET.
Right now, I am working on a web project in PHP and for the
I'm working on a web project using EJB 3.0, and whenever EclipseLink tries to
Currently I'm working on Web project that is built using ASP.NET Web Forms. We

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.