1
0
-1
    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Azhar

      Example Javascript and JQuery to calculate two dates in your Joget Form.

      Google has a lot of resources on this too.

       

      <script type="text/javascript">
      // Calculate age
      $(document).ready( function(){
          $('[name=dob]').change(function(){
              var myDob = $('[name=dob]').val();
              var myYob = parseInt(myDob.slice(-4));
              var myCY = parseInt('#date.yyyy#');
              var myAge = '';
              if (myYob !== '' && myYob < myCY) {
                  myAge = myCY - myYob;
                  $('[name=age]').val(myAge);
              } else {
                  $('[name=age]').val('0');
              }
          });
      });
      </script>

       

       
       
        CommentAdd your comment...