AnsweredAssumed Answered

How do  you set a default date form control to a specific date?

Question asked by Chuck Good on Apr 20, 2018
Latest reply on Apr 23, 2018 by Chuck Good

We have a contractor request form and I have collected their account expiration into a custom date field in L&G.  I have tried to use the field within an avform.setValue statement and it will not set the date field on the form.  However, it will set a text variable.


I am looking for ideas.


Any help is appreciated.


Here is what I am currently attempting,  


Set Variable non-visual with the account expiration date:

Debug shows  [startdate_text] = [2018-06-15 05:00:00.0]

then substring out the year, month, day  


year is ok, but the day and month are really strange 


avform.registerExprSub(null, "${avform.startdate_text}", function(value) { monthch = avform.startdate_text.substring(5,2); avform.setValue('month',monthch); });

Month comes out "018-"


avform.registerExprSub(null, "${avform.AccountExpireDay}", function(value) { daych = avform.AccountExpireDay.substring(8,2); avform.setValue('day',daych); });

Day comes out "18-06-"


Guess I will look for today function from text..but the substring sure is not acting the way I thought it should