• 0
NeoInJS

Date Calculation in a submission form

Question

Hello - I need help for  custom JS to compute and display the Calibration_Due in a submission form when the user inputs the Last_Calibration date and the Calibration_Frequency

 ·         Calibration_Due = Last_Calibration + Calibration_Frequency

 Where field types are

  • Calibration_Due – date
  • Last_Calibration  – date
  • Calibration_Frequency – number of months

Share this post


Link to post
Share on other sites

3 answers to this question

  • 0
On 2/15/2017 at 0:44 PM, NeoInJS said:

Hello - I need help for  custom JS to compute and display the Calibration_Due in a submission form when the user inputs the Last_Calibration date and the Calibration_Frequency

 ·         Calibration_Due = Last_Calibration + Calibration_Frequency

 Where field types are

  • Calibration_Due – date
  • Last_Calibration  – date
  • Calibration_Frequency – number of months

Hello,

Why don't you use formula field on the table level?

Example of the formula:

Dateadd(mm, [@field:Calibration_Frequency ],[@field:Last_Calibration])

If Java script is a better option for you, you may check this post

Share this post


Link to post
Share on other sites
  • 0

Quick question because I have similar issue.

What if you wanted the date to appear on the submission prior to the form being submitted? So if the user needed to change the date based on the calculation result they could? A formula field would give you the correct result but is not able to be displayed on the submission form.

Share this post


Link to post
Share on other sites
  • 0
16 hours ago, lmooring said:

Quick question because I have similar issue.

What if you wanted the date to appear on the submission prior to the form being submitted? So if the user needed to change the date based on the calculation result they could? A formula field would give you the correct result but is not able to be displayed on the submission form.

In this case, you may use java script only for displaying the value to a user. Depending on your requirements, you may execute function window.onload or 'onchange' of a specific field.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now