Jump to content

Automatically insert X months into a field


Recommended Posts

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"

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
Reply to this topic...

×   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...