Jump to content

Javascript Time Stamp Help Please


Recommended Posts

Hi,

I have a field named "todaysdate" and I am trying to add it into the timestamp script that I found on the message board.

Here is the javascript:

//(1) Declaration and initialization

Stamp = new Date();

var v_TimeStamp;

//(2) Construct the value of the v_TimeStamp variable in the format mm/dd/yyyy

v_TimeStamp=('' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getFullYear());

//(3) Field name - Date is referred with a prefix - EditRecord

document.forms[0].EditRecordDate.value=v_TimeStamp;

If you could guide me in the right direction that would be greatly appreciated.

Thank you,

J

Link to comment
Share on other sites

Hi,

You forgot to change the field name to the one that you have in your table.

Change this part of the code.

document.forms[0].EditRecordDate.value=v_TimeStamp;

to

document.forms[0].EditRecordtodaysdate.value=v_TimeStamp;

Also EditRecordFieldname is to access a field in a Search/Report DataPage. If you are trying to run this JavaScript for a webform then it would be InsertRecordFieldname.

Thanks,

Megha

Link to comment
Share on other sites

  • 9 years later...
  • 1 month 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...
 Share

×
×
  • Create New...