Select present and future dates only | Community
Skip to main content
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
santhosh_kumark
santhosh_kumarkAccepted solution
Level 6
Sep 11, 2020 6:03 PM UTC

Hi @grodlegacy ,

 

If your requirement is to restrict the author to not select a past date then it could be achieved with the minDate property with value as "today". Or you can achieve it using Jquery:

$(function() {
$( "#datepicker" ).datepicker({ minDate: 0});
});

 

Regards,

SK

18 replies

santhosh_kumark
santhosh_kumarkAccepted solution
Level 6
Sep 11, 2020 6:03 PM UTC

Hi @grodlegacy ,

 

If your requirement is to restrict the author to not select a past date then it could be achieved with the minDate property with value as "today". Or you can achieve it using Jquery:

$(function() {
$( "#datepicker" ).datepicker({ minDate: 0});
});

 

Regards,

SK

Translate
Level 2
Sep 17, 2020 7:16 PM UTC
@santhosh_kumark How about using JavaScript? AEM Designer uses JS.
Translate
Mayank_Gandhi
Employee
Sep 11, 2020 2:34 PM UTC

 

@grodlegacy  Use this on date picker:

 

 

var utc = new Date().toJSON().slice(0,10);
if(this.value<utc){

alert("do not select previous dates");
this.value=null;
guideBridge.setFocus(this);
}

Translate
Mayank_Gandhi
Employee
Sep 10, 2020 2:35 PM UTC

@grodlegacy  What kind of form are you developing? Is it PDF or Adaptive form.

Translate
Level 2
Sep 10, 2020 2:42 PM UTC
Adaptive
Translate