HongTaiLang Posted April 5, 2012 Report Share Posted April 5, 2012 How to insert the time which is 1 months after today into a field automatically? Quote Link to comment Share on other sites More sharing options...
fangjie Posted April 5, 2012 Report Share Posted April 5, 2012 If you would like to insert time into a Capture WebForm DataPage, insert following code <SCRIPT LANGUAGE="JavaScript"> //get current time var cur_time = new Date("[@cb:Timestamp]"); var new_month = cur_time.getMonth() + 2; var new_time; //get new time if (new_month == "13") new_time = ("01" +"/"+cur_time.getDate()+ "/"+(cur_time.getFullYear()+1)); else new_time = ('' + new_month + "/" + cur_time.getDate() + "/" + cur_time.getFullYear()); //insert new time into the field document.getElementById('InsertRecordFieldName').value= new_time; </SCRIPT> If you want to insert time into a Search Report DataPage, replace "InsertRecordFieldName" to "EditRecordFieldName" 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.