3rd party web based workflow application. Trying to get javascript to insert todays date into a grid date field if the field is empty.
If I set the following code:
function todayDate(){
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
if (dd<10) {
dd='0'+dd
}
if (mm<10) {
mm='0'+mm
}
today = yyyy+'/'+mm+'/'+dd;
$("#Travel_ItineraryDetails").setValue(today,1,1);
}
todayDate();
it inserts the date into the correct field. This also overwrites the date each time the user opens the form.
Grid name: Travel_ItineraryDetails
Field name: date
Field is the first field in the grid hence teh 1,1 in the .setValue command above.