Jump to content

Add days


Recommended Posts

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.

 

Link to comment
Share on other sites

  • 1 year later...

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>
Link to comment
Share on other sites

  • 3 years later...

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