Jump to content

Recommended Posts

I would like to store the Month and Year with a submission datapage. I used this logic..but it does not seem to work

 

<SCRIPT LANGUAGE="JavaScript">
 
function calculate(){
var v_currentDate=new Date();
 
 
 
document.getElementById("InsertRecordMonth").value = v.currentDate.getMonth();
document.getElementById("InsertRecordYear").value = v.currentDate.getFullYear();
 
 
}
 
 /* On submitting the webform, the function calculate is executed */
 document.getElementById("caspioform").onsubmit=calculate;
 
</SCRIPT>
Link to post
Share on other sites

instead of new Date, I think you want to point to your date input field.

 

Then you want to insert that into your other fields, but formatted differently.

 

But I would suggest just using one date field, and then using that one field multiple times in the report, once formatted for just year, once formatted for just month.

 

You might not need any js, and just 1 field.

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...
×
×
  • Create New...