Title: Datetime Dynamic min?
Last modified: December 22, 2021

---

# Datetime Dynamic min?

 *  Resolved [apexdigitalro](https://wordpress.org/support/users/apexdigitalro/)
 * (@apexdigitalro)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/datetime-dynamic-min/)
 * 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 4 years, 5 months ago by [apexdigitalro](https://wordpress.org/support/users/apexdigitalro/).

Viewing 1 replies (of 1 total)

 *  [Lap](https://wordpress.org/support/users/lapzor/)
 * (@lapzor)
 * [4 years, 5 months ago](https://wordpress.org/support/topic/datetime-dynamic-min/#post-15190011)
 * 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.

 * ![](https://ps.w.org/html-forms/assets/icon-256x256.png?rev=1754345)
 * [HTML Forms - Simple WordPress Forms Plugin](https://wordpress.org/plugins/html-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/html-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/html-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/html-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/html-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/html-forms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Lap](https://wordpress.org/support/users/lapzor/)
 * Last activity: [4 years, 5 months ago](https://wordpress.org/support/topic/datetime-dynamic-min/#post-15190011)
 * Status: resolved