Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Nadesj
Posts: 6 Joined: Thu May 21, 2015 12:30 pm
Unread post
by Nadesj » Wed May 27, 2015 2:27 pm
I tried to prepopulate the date picker field with the current date like this:
Code: Select all
var currentOnClick = e.getAttribute('onclick');
e.setAttribute('onclick', currentOnClick+';nuPopupCalendar(this);');
var currentOnBlur = e.getAttribute('onblur');
e.setAttribute('onblur', currentOnBlur+';nuBlurDateField()');
$(".date-pick").datepicker();
$(".date-pick").datepicker("setDate", new Date());
in nueditform.js but that seems not to work.
admin
Site Admin
Posts: 2825 Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 29 times
Unread post
by admin » Thu May 28, 2015 1:13 am
Nadesj,
Try this..
Code: Select all
var d = $("#the_date").attr('data-nuformat');
var f = nuFormats[d].format
$("#the_date").val(nuFormatDateByString(new Date(), f));
Or even easier..
curdate.PNG
Steven
You do not have the required permissions to view the files attached to this post.
Nadesj
Posts: 6 Joined: Thu May 21, 2015 12:30 pm
Unread post
by Nadesj » Thu May 28, 2015 9:27 am
Simple is good enough, it works, thank you Steven.