Tagged: 

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #728462

    Hi!
    I would like to disable past dates in the datepicker so users can’t select them. Could you please help me with this?
    I have been working with Enfold for a few months and I think it is amazing! however I am not too experienced in CSS. Could you give me some advice on how to best solve this?
    Thanks a lot!

    #728483

    Hey robertruedam,

    We would definitely recommend you to use a child theme – http://kriesi.at/documentation/enfold/using-a-child-theme/ in order to avoid applying the same changes each time you update the theme.

    Please copy unmodified enfold/framework/php/class-form-generator.php file and paste it inside enfold-child folder and find following at the top and remove it (please do not remove PHP opening tag)

    
    if (  ! defined( 'AVIA_FW' ) ) exit( 'No direct script access allowed' );
    

    and then add following code to Functions.php file of your child theme

    
    require( 'class-form-generator.php' );
    

    Then open class-form-generator.php file in your child theme and find

    
    class avia_form extends aviaFramework\base\object_properties
    

    and change it to:

    
    class avia_form //extends aviaFramework\base\object_properties
    

    Then, find the following line:

    
    echo 'jQuery( function(){ jQuery(".avia_datepicker").datepicker({
    

    then add the following right below that line

    
    minDate: 0,
    

    Best regards,
    Yigit

    • This reply was modified 1 year ago by Yigit. Reason: Updated the instructions
    #728875

    Hi Yigit, thank you so much for the fast reply.

    I followed your indications but it doesn’t seem to make any difference.

    Also, I am indeed using a child theme. Is there anything I missed?

    Thanks in advance,

    Robert

    #728973

    Hi,

    Can you please post FTP logins here privately as well so we can look further into it? :)

    Best regards,
    Yigit

    #729280

    Hi Yigit,

    I found out yesterday that my booking engine partner is using a plugin (WP Datepicker) for the calendar and I couldn’t see it, i’m sorry.
    The plugin author advised me to modify the plugin adding a snippet from jQuery website, but nothing specific so I’m still trying.

    I don’t know if this is something you guys can help me with although I would appreciate it if that’s possible

    Thank you for the support, You guys are fast!

    Rob.

    #729392

    Hi,

    It does work fine. You are using a plugin to display datepicker on your frontpage.
    I created a private test page and deactivated your plugin and it did work fine.
    Please review your website now and contact plugin authors if you would like to apply the changes on their plugin :)

    Best regards,
    Yigit

    #917352

    Is this the right code to make it invisible?

    #top .avia-datepicker-div.ui-datepicker .ui-datepicker-prev {
    left: 2px;
    display: none;
    }

    Thanks Yigit

    #917519

    Hi,

    Yes, if that works it should work out for you also!
    Have you tried it and you are having issues?

    Best regards,
    Basilis

    #959047

    Dear Team,
    with
    minDate: 0,
    in class-form-generator.php after
    echo ‘jQuery(document).ready(function(){ jQuery(“.avia_datepicker”).datepicker({
    calendar works well with the previous dates disabled but…
    the date field can be manipulated manually (it is possible to write the date without choosing the day from the calendar).
    is there a way to not allow to write manually in the date field?
    Otherwise everything is useless if the user can manually correct the date…
    Thanks in advance
    Lion

    • This reply was modified 6 years, 7 months ago by lion73.
    #959385

    Hi Lion,

    Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)

    Best regards,
    Victoria

    #960185

    “Unfortunately, it would require quite some time and customization of the theme to achieve this, so I am sorry to tell you that this is not covered by our support. However, if it’s really important for you to get this done, you can always hire a freelancer to do the job for you :)”
    Dear Victoria, this is not a customization…date field that can be manipulated manually it’s something comparable to a bug.
    It is clear that you are not able to solve the problem.
    UPDATE: problem solved by adding a very small piece of code!
    Victoria…shameful support service.

    • This reply was modified 6 years, 7 months ago by lion73.
    #960370

    Hi,


    @lion73
    Glad you figured it out! Adding “readonly” attribute to input tag should disable manual entries.
    Sorry for the experience. While we normally do not mind helping with small customizations, we try to keep them to minimum when forums are busy. And after recent updates, forums are currently busy :)

    Hopefully we will be able to change your thoughts about our support in future :) I am closing this thread for now. If you have any other questions or issues, please feel free to start a new thread under Enfold sub forum!

    Best regards,
    Yigit

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘Disabling past dates in datepicker’ is closed to new replies.