ppbb123 Posted January 22, 2013 Report Share Posted January 22, 2013 How can I add 10 days to the registration day?? Thank you. ArdmxurEn 1 Quote Link to comment Share on other sites More sharing options...
MayMusic Posted January 22, 2013 Report Share Posted January 22, 2013 Try this : <script> function f_date(){ var v_currentDate=new Date(); v_currentDate.setDate(v_currentDate.getDate() +10); 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(); </script> You can place this code in the footer of the submission page and you need to replace ID with the ID of the date field you would like to keep the date in. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted December 11, 2014 Report Share Posted December 11, 2014 If you want t0 add to a date which is being selected on the page then use <script> function f_date(){ var v_currentDate=new Date(document.getElementById('InsertRecordDATEFIELDNAME').value); v_currentDate.setDate(v_currentDate.getDate() +10); var v_assignDate = (v_currentDate.getMonth() + 1) + "/" + v_currentDate.getDate() + "/" + (v_currentDate.getFullYear()); alert(v_assignDate); document.getElementById('InsertRecordNAME OF THE FIELD WHERE YOU WANT TO SAVE THIS DATE IN').value = v_assignDate; } document.getElementById('InsertRecordDATEFIELDNAME').onchange=f_date; </script> ArdmxurEn 1 Quote Link to comment Share on other sites More sharing options...
cheonsa Posted October 24, 2018 Report Share Posted October 24, 2018 Hi @ppbb123, 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...
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.