Select present and future dates only

Avatar

Avatar

GRodLegacy

Avatar

GRodLegacy

GRodLegacy

10-09-2020

Hello, I wanted to ask if there is a way to have someone only be able to select a date that is today or a later date but not past dates. Is this possible? Thank you in advance.

date date and time field date drop down date picker date range

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

santhosh_kumark

MVP

Avatar

santhosh_kumark

MVP

santhosh_kumark
MVP

11-09-2020

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

Answers (2)

Answers (2)

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

11-09-2020

 

@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);
}

Avatar

Avatar

Mayank_Gandhi

Employee

Avatar

Mayank_Gandhi

Employee

Mayank_Gandhi
Employee

10-09-2020

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