• Resolved apexdigitalro

    (@apexdigitalro)


    Hello, it’s me again.

    I am trying to use jquery to set a min-date for the datetime field.

    However, it does not seem to be working. Does your plugin support jQuery?

    Here’s what I’m trying to do:

    <input type="datetime-local" name="test" id="timetest" required/>

    And the script:

    <script>
    jQuery(document).ready(function(){
      elem = document.getElementById("timetest")
      var iso = new Date().toISOString();
      var minDate = iso.substring(0,iso.length-1);
      elem.value = minDate
      elem.min = minDate
    });
    </script>

    The error returned is that jQuery is not defined…which is strange

    • This topic was modified 3 years, 3 months ago by apexdigitalro.
Viewing 1 replies (of 1 total)
  • Hi,

    You can add any code you want to the form / we do nog block jquery. But of course you do need to load jquery in your site/theme is it isn’t already. Try typing jQuery in the browser console.

    We re not able to check your custom code for you / provide support on writing the actual code though.

    Hope that helps. If you have any questions, please let me know!

Viewing 1 replies (of 1 total)
  • The topic ‘Datetime Dynamic min?’ is closed to new replies.