Skip Navigation

[Resolved] Custom date field picker in cred form, or just type the date

This thread is resolved. Here is a description of the problem and solution.

Problem:

I need to quickly enter dates into cred forms. with the date picker it takes some time to get the date updated.

Is there a way to change the date picker input which is used by the cred form?

Solution:

The custom date field created with Types plugin will store value in timestamp format, I don't think your users can input the timestamp value quickly.

As a workaround, you can create another single line field for user inputting value in date format, after user submit the form, use action hook cred_save_data to trigger a PHP function, for example:

https://toolset.com/forums/topic/custom-date-field-picker-in-cred-form-or-just-type-the-date/#post-1306221

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

This support ticket is created 5 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Alex 5 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1306187

I need to quickly enter dates into cred forms. with the date picker it takes some time to get the date updated.
Is there a way to change the date picker input which is used by the cred form?

#1306221

Hello,

The custom date field created with Types plugin will store value in timestamp format, I don't think your users can input the timestamp value quickly.

As a workaround, you can create another single line field for user inputting value in date format, after user submit the form, use action hook cred_save_data to trigger a PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

In this PHP function, do these:
1) Get single line field field value
https://codex.wordpress.org/Function_Reference/get_post_meta

2) Turn it into timestamp format
hidden link

3) Save timestamp value into your custom date field
https://codex.wordpress.org/Function_Reference/update_post_meta

#1306363

Hi Luo,

Thanks for your reply.
What I mean is the Date Input Popup on front end CRED forms.

Is it possible to style it, that people can enter the date also with keyboard. Now it is only possible to select the date by clicking Year, Month and day. How can I style the input form on CRED Forms, that the date can be filled out by keyboard ?

Thanks for your help
Alex

#1306373

Dear Alex,

There isn't such kind of built-in feature within Toolset Forms plugin:
Is it possible to style it, that people can enter the date also with keyboard
the date-picker is required by default, since it need to turn the date value into timestamp value.

#1306435

On this website one can enter the date by keyboard:
hidden link?
I think it is the same jquery datepicker

#1306511

Thanks for the link, the demo you mentioned above does not convert date value into timestamp value too, for example:
The timestamp value of date "08/01/2019" is: 1564617600, you can get more help about timestamp here:
hidden link

Since there isn't such a built-in feature within Toolset Forms plugin, you might consider custom codes, but according to our support policy, we don't provide custom codes support:
https://toolset.com/toolset-support-policy/

You can check it with our Toolset Contrators:
https://toolset.com/contractors/

You can also add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Our developers will evaluate it.

#1308845

I will open a feature request for this