Tagged: datepicker
-
AuthorPosts
-
April 4, 2016 at 11:17 pm #607942
Hi,
I’m using the default Enfold contact form to book a restaurant table and for this I need to disable the Sunday and Monday. I found other threads mentioning looking at line 366 of file /enfold/framework/php/class-form-generator.php but the line mentioned is not the same as the code I see on line 366.
Any help on this would be much appreciated.
Regards,
DanielApril 6, 2016 at 1:16 pm #608919Hey strila!
We are working on your ticket please wait while we update the results here soon.This can be done using CSS and you can remove background gold it is just for visual clue
.ui-datepicker-calendar .ui-datepicker-week-end+.ui-datepicker-week-end a.ui-state-default, .ui-datepicker-calendar tr > td:first-child a.ui-state-default { background-color: gold; pointer-events: none; }
Best regards,
Vinay- This reply was modified 8 years, 8 months ago by Vinay.
April 7, 2016 at 9:22 am #609444Thanks Vinnie! It works :)
Can you briefly explain the css parts for me or perhaps a link to more info? Can I do the same with dates in the past?
Thanks again, Daniel
April 7, 2016 at 11:44 am #609497I also find that
pointer-events: none;
isn’t working on mobile (iOS).April 7, 2016 at 11:55 am #609511Hey!
not sure which kind of css explanation you want, but Google gives you good css tutorials: http://www.w3schools.com/css/
Can you provide us a precise link with the elements in question please? we need to be able to inspect them.
Try to add an !important:
.ui-datepicker-calendar .ui-datepicker-week-end+.ui-datepicker-week-end a.ui-state-default, .ui-datepicker-calendar tr > td:first-child a.ui-state-default { background-color: gold; pointer-events: none !important; }
and clear browser cache afterwards. Check on another mobile device as well.
Best regards,
AndyApril 7, 2016 at 1:05 pm #609569Hi Andy,
I know some CSS, thanks :) When I ask a question I often think: could I have done this myself? I’m not sure in this case.
Check link in private section. !important was already added. Checked on iOS Safari + Chrome, normal and incognito mode, several devices used. The color works, the pointer-events don’t. From what I read here the pointer-events property isn’t very compatible with non-SVG content.
April 7, 2016 at 1:36 pm #609600Hi!
Please go to enfold/framework/php/class-form-generator.php file and find following line
echo 'jQuery(document).ready(function(){ jQuery(".avia_datepicker").datepicker({
and add following right below it
beforeShowDay: function(date) { var day = date.getDay(); return [(day != 1 && day != 0)]; },
Cheers!
YigitApril 7, 2016 at 1:43 pm #609606Hi Yigit,
awesome, thanks! Can I use this file in my child-theme? Copying the framework/php/class-form-generator.php structure doesn’t seem to work.
April 7, 2016 at 2:01 pm #609618Hey!
Please copy unmodified file and paste it inside enfold-child folder and edit the line i mentioned above and find following line at the top
<?php if ( ! defined( 'AVIA_FW' ) ) exit( 'No direct script access allowed' );
and change it to
<?php
then add following code to Functions.php file of your child theme
require( 'class-form-generator.php' );
Regards,
YigitApril 7, 2016 at 2:20 pm #609627Yep, this works. Thanks so much! :)
I changed it to
require( 'framework/php/class-form-generator.php' );
so I can keep the original structure and keep ways organised.- This reply was modified 8 years, 8 months ago by Daniel.
April 7, 2016 at 2:31 pm #609637 -
AuthorPosts
- The topic ‘Datepicker's configuration of the contact form’ is closed to new replies.