Jump to content
Sign in to follow this  
ppbb123

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.

 

Share this post


Link to post
Share on other sites

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>

Share this post


Link to post
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...
Sign in to follow this  

×
×
  • Create New...