You are viewing limited content. For full access, please sign in.

Question

Question

Forms Autofill Date on load

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

Replies

replied on December 13, 2016

Hi Robert,

Instead of using JavaScript to fill your date field, you can use built-in functionality to load the current date. On your date field, set the default value to "today" by using the token picker. Hope this helps!

3 0
replied on May 22, 2019

It appears I can only use current_date or current_datetime for Forms 10.3.x

0 0
replied on July 21, 2022

In my case, no appear the current date, my version is  down  for Forms 10.3.x

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.