mikelawrence
Programmer
I want to get todays date and post it to another site that i do not have control off (salesforce.com). I think the problem is that the name of the field starts with a numeric and so javascript will not write to it.
My javascript date function is below:
var todaysdate = new Date();
var date = todaysdate.getDate();
var day = todaysdate.getDay() + 1;
var month = todaysdate.getMonth() + 1;
var yy = todaysdate.getYear();
var now=day+"/"+month+"/"+yy;
document.form2.00N20000000kUr52.value=now;
which gives me an error on the last line but if i change the last line to
document.form2.last_name2.value=now;
it appears to work, well at least it doesn't come back with an error. Am i right in this and if so is there a way around this? I'm also calling the function on a OnSubmit button, is there a better way of doing this so i can display the date on the page before I submit?
I'd appreciate any help,
mike
My javascript date function is below:
var todaysdate = new Date();
var date = todaysdate.getDate();
var day = todaysdate.getDay() + 1;
var month = todaysdate.getMonth() + 1;
var yy = todaysdate.getYear();
var now=day+"/"+month+"/"+yy;
document.form2.00N20000000kUr52.value=now;
which gives me an error on the last line but if i change the last line to
document.form2.last_name2.value=now;
it appears to work, well at least it doesn't come back with an error. Am i right in this and if so is there a way around this? I'm also calling the function on a OnSubmit button, is there a better way of doing this so i can display the date on the page before I submit?
I'd appreciate any help,
mike