Datepicker

mduda 19 Jun, 2016
Hi Bob,

I'm able to use the datepicker, however, when I add a model - in this case GSheet[cb_student1birthday], the date picker show with nan.

I'm using a DB Read to pull the dates from CB, but the user still needs to be able to enter dates or adjust them after the data is loaded into the form. Any ideas?
GreyHead 19 Jun, 2016
Hi mduda,

Please check that you don't have [] in the datepicker element ID - use e.g. GSheet_cb_student1birthday for that (and leave the Name with the brackets).

Bob
mduda 19 Jun, 2016
You're right - it's the special characters that is throwing it off. I have the GSheet save action enabled, and need to pass this date to it. How should I go about doing this if I can't use the model format?
GreyHead 19 Jun, 2016
Hi mduda,

You can leave the name as GSheet[cb_student1birthday] and just change the id to GSheet_cb_student1birthday

Bob
mduda 19 Jun, 2016
I was wrong...I actually had the id named properly without special characters. All along I thought the issue was that the name was in the form of GSheet[cb_student1birthday]. Not the case🙄

The issue is that any date fields in the table that are empty show 0000-00-00. So I guess when the DB Read pulls that date, it somehow creates the error. ??

Is there a way to add a custom code in the load action to get around this maybe? Or something else I might be missing?
GreyHead 19 Jun, 2016
Hi mduda,

You can probably edit the table so that the default value for the data is NULL

Bob
mduda 20 Jun, 2016
[attachment=0]date_null.png[/attachment]

Doesn't the empty date field show up as 0000-00-00 ? Not 'Null'?

Just trying to figure out a work-around on this one... I put a custom code in the DB Read "On Found" section as
[attachment=1]customcode_changedate_null.png[/attachment]

The result on the form loads 'Null', however the calendar still has nan error. Probably a problem when the DB initially loads? Is there any other adjustment, ideas/fix for the datepicker field?
GreyHead 20 Jun, 2016
Hi Mduda,

Try setting the value to an empty string '' instead of 'null'.

Bob
mduda 20 Jun, 2016
Jackpot!!!🤣

Thanks for helping me with the work-around on this one! (sent a beer your way).
This topic is locked and no more replies can be posted.