Cameron Posted April 20, 2016 Report Share Posted April 20, 2016 Hello everyone, I believe, this answer was on the forum, but I cannot found it. Please help! Thank you for your time! Quote Link to comment Share on other sites More sharing options...
Xiang Posted April 20, 2016 Report Share Posted April 20, 2016 Hi Cameron, How are you? I think, you can use the following script: <SCRIPT LANGUAGE="JavaScript"> function setDate() { var firstDateFieldName = "first"; var secondDateFieldName = "second"; firstDateFieldName = "InsertRecord" + firstDateFieldName; secondDateFieldName = "InsertRecord" + secondDateFieldName; var f_Date = document.getElementById(firstDateFieldName ).value; var first_Date = new Date(Date.parse(f_Date)); var result_Date = new Date (first_Date.setMonth(first_Date.getMonth()+1)); var d_month = result_Date.getMonth() + 1; if (d_month<10) {d_month = "0" + d_month;} var d_day = result_Date.getDate(); if (d_day<10) {d_day = "0" + d_day;} var d_year = result_Date.getFullYear(); var str_date = d_month + "/" + d_day + "/" + d_year; document.getElementById(secondDateFieldName ).value = str_date; } document.getElementById("caspioform").onsubmit=setDate; </SCRIPT> Let me know, if something doesn't work. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted April 21, 2016 Report Share Posted April 21, 2016 use this in the footer or HTML Block below all elements: <script> document.getElementById('InsertRecorddate').onblur= function (){ var d = new Date( document.getElementById('InsertRecorddate').value ); d.setMonth( d.getMonth( ) + 1 ); document.getElementById('InsertRecorddate2').value = ( d.getMonth( ) + 1 ) + '/' + d.getDate( ) + '/' + d.getFullYear( ); } </script> Replace InsertRecorddate with the ID of the Date field and InsertRecorddate2 by the ID of the field where you want to save the new date. Quote Link to comment Share on other sites More sharing options...
scribblemilk Posted July 13, 2016 Report Share Posted July 13, 2016 Hi MayMusic, Is there a way of combining your solution above with the below topic to increment the Date value by one month where the Week calendar shows a cross over month? This is really stumping me any help greatly appreciated Quote Link to comment Share on other sites More sharing options...
Kurumi Posted June 24, 2019 Report Share Posted June 24, 2019 Hi Cameron, You might refer to this post: You can use the DATEADD(mm, 1, [@field:DATEFIELD]) in Calculated Value without using JS. 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.