I am trying to: add only Time picker field, without date.
I visited this URL: https://toolset.com/forums/topic/timepicker-only/
I expected to see: a hour field
Instead, I got: both time and date.
maybe i can do something like this:
create a php function using cred hooks that pre-set date, and then hide only the date using css.
like in this case: https://toolset.com/forums/topic/auto-fill-parent-field-in-cred-form/page/2/#post-320324
can you help me do that?
Dear shirlyk,
What kind of Time picker field do you need?
Is it two dropdown menu: one for hour, anther for the minute?
If it is, I suggest you create two custom select fields:
one for hour, anther for the minute
Then use the CRED action hook cred_save_data to save it as what you want:
cred_save_data
Hook to do custom action when post data are saved to database.
https://toolset.com/documentation/user-guides/cred-api/#csd
hey luoy,
thanks for the help!
i don't understand how to use the hook and why?
also- isn't there a way to "hide" the date field and use only the hour/minuet that is already in toolset?
s.
Since you are requesting for display only hour field, I think it would be more easier to setup a dropdown menu of hour field within CRED, and with CRED action hook cred_save_data, you will be able to save the data as what you want, but both ways is possible, both needs custom codes, it depends on you,
If you need more assistance for it, please duplicate same problem in a test site, and fill below private detail box with login details and ftp access, also point out the problem page URL and CRED form URL, and where I can edit your PHP codes, and which one is the problem custom date field, what value do you want it to be stored into database. I need test and debug it in a live website. thanks
Could you describe more details for the what you are going to do?
Are you going to setup a custom date field value in database, = today's time stamp value + hours of the select field?
hey
i want the user to add "opening hours" for his listing (cpt). each listing can have many opening hours.
so i want to have a custom field name "time", for example. it will contain a dropdown for hour and a dropdown for minuets. i don't need the date at all.
when i tried to add the code to the custom function in PHP - my site went down...
can you write me the proper code i need to put in the function.php?
thank you 🙂
I just tested the credentials you provided in private detail box, it does not work any more, I get this error:
Invalid email or username entered
So I tested it in my localhost, if I use CSS codes to hide the datepicker of custom date field, it will not store the value into database even I choose any options in hour's dropdown and Minute dropdown, so there isn't any way to to "hide" the date field and use only the hour/minuet that is already in toolset.
Since you need multiple instance field, in your case, I suggest you try with our document:
So I suggest you try with our document: Creating Groups of Repeating Fields
https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/
1) Create a child post type "open-hour",
2) Add two custom select dropdown fields to the post type "open-hour":
a) Hour (0~24)
b) Minute (0~59)
Then you will be able to setup them in admin side, and display them in front-end:
https://toolset.com/documentation/user-guides/querying-and-displaying-child-posts/
thank you.
when i display the parent cred- is it possible to show also the child-post-type fields in the same page?
for example: the user edit a cred with general info about his listing. also- he can edit the hours fields (which is a child post).
thanks!
Unfortunately, according to W3C form within form is not allowed, so it is not possible to show also the child-post-type fields in the same form, I add the "only Timepicker, without date" into our to-do list as a feature request, our developers will take care of it, but there isn't any ETA for it.
Hello Shirlyk,
We've included this feature in our internal queues as a feature request and to be honest, I don't have an accurate information about when this would be implemented.
I'm closing this ticket since this feature request is already included in our internal queues and you always can follow the Types plugin changelog page: https://toolset.com/download/toolset-types/#changelog to know the newly added features to the Types plugin.
Thanks.