Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>That's your choice how you want to impliment the validation.There are 2 ways which as of now seems feasible to me</p> <ol> <li>Client side validation using JavaScript.</li> <li>Server Side validation in your action class.</li> </ol> <p>For the first part your both data-picker must have id and name so once user filled <code>ToDate</code> and <code>FromDate</code> 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 <code>document.getEmelemntById()</code> and can run your comparison logic.</p> <p>Other option is to let Struts2 fill the <code>ToDate</code> and <code>FromDate</code> values in your action class and you can use <code>validate</code> method inside your Action to perform date validation.choice is all yours.</p> <p>You can even play around with validation framework even.</p> <p><strong>Update</strong></p> <p>After playing around with J query plugin source code here is the workaround we have</p> <pre><code> &lt;s:form id="form" theme="xhtml"&gt; &lt;sj:datepicker id="date12" name="date12" label="With Close Event" onCompleteTopics="onDpClose"/&gt; &lt;sj:datepicker id="date13" name="date13" label="With Min and Max Date" minDate="0" maxDate="+2m"/&gt; &lt;/s:form&gt; &lt;script type="text/javascript"&gt; $.subscribe('onDpClose', function(event,data) { $('#date13').datepicker( "option" , 'minDate',event.originalEvent.dateText ); }); &lt;/script&gt; </code></pre> <p>In similar way can work for other way around.Hope this will work for you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload