0

I want a validation for no past dates i.e something like

StartDate>=Today

Is this possible can anyone help? Thanks...

  • @RobWindsor, the first hit on that query is already pointing to this question. So your comment causes and endless loop, human stack overflow :D ⁽ᶦ ᵈᵒ ʰᵃᵛᵉ ᵃ ˢᵉʳᶦᵒᵘˢ ᵖᵒᶦᶰᵗ ᵗʰᵒᵘᵍʰ⁾ – eirikb May 2 '14 at 6:43
2
var startDateStr = $("#startdate").val();
var startDateArr = startDateStr.split("/");
var startDate = new Date(startDateArr[2], startDateArr[0], startDateArr[1]);
var todayDate = new Date();

if (startDate >= todayDate) {
   $("<div class=\"message-warning\">Your Message!</div>")
    .insertAfter("#enddate");
};
  • Anuja, using this, can i compare two date time fields? – SaMolPP Nov 2 '15 at 9:27
1

Please check this link

If the result is in negative return false in PreSaveAction() check here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.