iFormBuilder JavaScript Tips & Tricks
Get the Month of the Year
To get the month from the current date you will need to put this in the page level javascript of the form:
var today = new Date()
var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
var monthName = monthNames[today.getMonth()]
In the dynamic value of a text or read-only element put monthName and it will give you the current month of the year.
OR
To get the month from the date entered previously in the form put this in the page level javascript of the form:
var monthNames = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]
Put monthNames[date_data_column_name.getMonth()] in the dynamic value of a text or read-only element.
Comments
0 comments
Please sign in to leave a comment.