Jump to content
  • 0

Date Calculation in a submission form


NeoInJS

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
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 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

Link to comment
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.

Link to comment
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.

Link to comment
Share on other sites

  • 0

Hi all,

 

Just to give you an update, one of the new features of Caspio is Calculated Value in Submission Form. The Calculated Value form element generates dynamic calculations that automatically update as users interact with your form.

For more information, please refer to this link: https://howto.caspio.com/datapages/datapage-components/calculated-values/

 

Hope this helps.

 

Regards,

kristina

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...