Page 1 of 1

Set Value of one DatePicker by Selecting Date of another

Posted: Fri Jul 25, 2014 9:04 pm
by Matthew6439702

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.


Set Value of one DatePicker by Selecting Date of another

Posted: Fri Jul 25, 2014 9:32 pm
by Matthew6439702

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?


Set Value of one DatePicker by Selecting Date of another

Posted: Fri Jul 25, 2014 9:38 pm
by Matthew6439702

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.


Set Value of one DatePicker by Selecting Date of another

Posted: Fri Jul 25, 2014 9:40 pm
by obullei

Hello!

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


Set Value of one DatePicker by Selecting Date of another

Posted: Fri Jul 25, 2014 9:46 pm
by Matthew6439702

Thank You!


Set Value of one DatePicker by Selecting Date of another

Posted: Sun Jul 27, 2014 12:49 am
by Matthew6439702

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


Set Value of one DatePicker by Selecting Date of another

Posted: Sun Jul 27, 2014 1:41 am
by Alena Prykhodko

Great you are! Thank you for sharing.


Set Value of one DatePicker by Selecting Date of another

Posted: Mon Jul 28, 2014 3:40 am
by Matthew6439702

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


Set Value of one DatePicker by Selecting Date of another

Posted: Mon Jul 28, 2014 9:24 pm
by obullei

Hello!

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