asked on December 13, 2016
•
Show version history
Hi,
I'm trying to autofill a date field with the current date on load of the form. Here's the current bad code:
$(document).ready(function () { var d = new Date(); var month = d.getMonth()+1; var day = d.getDate(); var output = d.getFullYear() + '/' + (month<10 ? '0' : '') + month + '/' + (day<10 ? '0' : '') + da $('#q1').val(output).trigger('change'); });
Thanks for any help.
0
0