nestorwagner Posted January 24, 2013 Report Share Posted January 24, 2013 Hi everyone, I have two date fields -- reg and deadline. I want to store in the deadline field the following: reg + 7 days. Does anyone know the java script to be inserted in the submission form (in the footer)? In the alternative, does anyone know the script to write in the deadline field the following: today() + 7 days Thank you!! Quote Link to comment Share on other sites More sharing options...
0 MayMusic Posted January 24, 2013 Report Share Posted January 24, 2013 refer to this post:http://forums.caspio.com/viewtopic.php?f=3&t=14334 In your case you can change it to: function f_date(){ var v_currentDate=new Date(); v_currentDate.setDate(v_currentDate.getDate() +7); var v_assignDate = (v_currentDate.getMonth() + 1) + "/" + v_currentDate.getDate() + "/" + (v_currentDate.getFullYear()); alert(v_assignDate); document.getElementsByName('ID')[0].value = v_assignDate; } f_date(); Change the ID with your field ID where you want to save your deadline date. If you cannot get the ID give me the link to help you on that Quote Link to comment Share on other sites More sharing options...
0 nestorwagner Posted January 24, 2013 Author Report Share Posted January 24, 2013 Thank you!! Quote Link to comment Share on other sites More sharing options...
0 nestorwagner Posted January 24, 2013 Author Report Share Posted January 24, 2013 Sorry, but I could not figure out the Field ID. Here is the link: www.scsimedia.com/testfieldid.html Please input the following password: test Thank you!! Quote Link to comment Share on other sites More sharing options...
0 cheonsa Posted October 24, 2018 Report Share Posted October 24, 2018 Hi @nestorwagner, Good news! Calculated values in submission form is now a standard feature of Caspio. You do not have to add custom coding to achieve it. You may check this link for reference: https://howto.caspio.com/datapages/datapage-components/calculated-values/ Regards, kristina Quote Link to comment Share on other sites More sharing options...
Question
nestorwagner
Hi everyone,
I have two date fields -- reg and deadline. I want to store in the deadline field the following: reg + 7 days.
Does anyone know the java script to be inserted in the submission form (in the footer)?
In the alternative, does anyone know the script to write in the deadline field the following: today() + 7 days
Thank you!!
Link to comment
Share on other sites
4 answers to this question
Recommended Posts
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.