Matthew6439702
Posts: 0
Joined: Sun Nov 24, 2013 1:10 am

Set Value of one DatePicker by Selecting Date of another

I have been working on this problem for a while. I am trying to populate one DatePicker from another. One I am using as a log ID for Sorting purposes but I want both dates to match.

The first DatePicker runs on Page Load:

var dateElement = Appery("date");
dateElement.setProperty("defaultDateValue", $.datepicker.formatDate(dateElement.datepicker_dataPickerOptions.dateFormat, new Date()));
No Problems with this JS on Load

Now the second DatePicker "LogDate" I am trying to populate upon the date change of DatePicker "date".

I have inserted this JS to run upon value change of "date":

var DateVal = DateName.val();
var dateElement = Appery("LogDate");
dateElement.setProperty(DateVal);

I have tried many combinations and I am hoping I am missing something really simple here.

Matthew6439702
Posts: 0
Joined: Sun Nov 24, 2013 1:10 am

Set Value of one DatePicker by Selecting Date of another

Tried correcting JS with this:

var DateVal = DateName.val();
var ChangeDate = Appery("LogDate");
var getval = ChangeDate;
getval.val(DateVal);

Am I in the Ball Park?

Matthew6439702
Posts: 0
Joined: Sun Nov 24, 2013 1:10 am

Set Value of one DatePicker by Selecting Date of another

Does This matter?

DateName format = DD, d MM, yy (I use this to Display with List/Query)
LogDate format = mm/dd/yy (I use this to Sort List/Query)

Otherwise The List does not sort chronologically if I just use DD,d MM, yy format.

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Set Value of one DatePicker by Selecting Date of another

Hello!

We are working on it.
I will let you know when have more information from developers team.

Matthew6439702
Posts: 0
Joined: Sun Nov 24, 2013 1:10 am

Set Value of one DatePicker by Selecting Date of another

Figured it OUT this works....

var dName = Appery("DateName");
var dNameVal = dName.val();
var getval = Appery("LogDate");
getval.val(dNameVal);

I knew it was something simple I was missing! :D

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Set Value of one DatePicker by Selecting Date of another

Great you are! Thank you for sharing.

Matthew6439702
Posts: 0
Joined: Sun Nov 24, 2013 1:10 am

Set Value of one DatePicker by Selecting Date of another

I thought I got this working but just found realized it is not working. So I think I was mistaken.

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Set Value of one DatePicker by Selecting Date of another

Hello!

Please try to use this code:
codevar dName = $("[name=DateName] input").val();
$("[name=LogDate] input").val(dName);/code

Return to “Issues”