JoomDev: Appointment Form - different time pick for Saturday (1/1)
Welcome, Guest
Username: Password: Remember me

TOPIC: Appointment Form - different time pick for Saturday

Appointment Form - different time pick for Saturday 2 months 1 day ago #8304

  • pete
  • pete's Avatar
  • Offline
  • Senior Member
  • Posts: 59
  • Thank you received: 1
  • Karma: 0
I want to modify the Appointment form to reflect the clinic's opening hours:
Mon-Fri 9am-5pm
Sat 9am-1pm
I was able to restrict the date to Mon-Sat, and starting date for tomorrow, using the date's advanced settings:



I was able to restrict the time using the similar steps:



I created another time called Sat-time, which I restricted the hours to 9am-1pm.

The idea is, to have the the "Time" to show when it is Mon-Fri and "Sat-time" when it is Saturday.
I'm trying similar method as when you select departments and doctors...
In date field, I'm trying to have this event:
If date=Sat, then hide "time" and show "Sat-time"
if date=Mon,Tue,Wed,Thu,Fri then show "time" and hide "Sat time".
When I open the events tab in the of the date picker, I don't know how to extract the value of Saturday for it to work...



any ideas how to make it work?
or any other work-around?

thanks,
pete
The administrator has disabled public write access.

Appointment Form - different time pick for Saturday 1 month 4 weeks ago #8347

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Posts: 1225
  • Thank you received: 171
  • Karma: 34
Hi Pete,

I had a look at this and I don't think it will work using the ChronoForms Events tab, since the value(s) you provide in there will always be static.

Think of it this way, The value of the actual field returned will be 2018-09-17 (or whatever your date format is) but you will be checking it against a static value (Saturday or 06 or something along the lines) so it will never match.

The way I think this is possible is to write some custom javascript that will do the following:
a. get the value of the datepicker field using jquery onchange event.
b. parse the value into jquery's date function to check if the date parsed is a saturday or week day.
c. Hide/Show the particular fields (time picker) based on the day returned from the above.

I really wish I could provide you with the Javascript for the above, but this is way beyond my current level of expertise in Javascript.

Hope this helps Pete.

Thanks,
Chetan
Thank You,
If you like our support and products, tweet us at joomdev and let the world know about it.
The administrator has disabled public write access.
Time to create page: 0.393 seconds