Can someone help me write a function for showing a line of text (preferably by showing a css class) for a jquery datepicker after someone has clicked a date?
The notice has to appear IF the date picked falls between TODAY and 21 DAYS FROM TODAY.
It's the function I need help with, as I don't know how to write it.
<script>
$(function() {
$( "#delivery_date" ).datepicker({
dateFormat: "dd/mm/yy",
});
});
</script>
<input type="text" id="delivery_date" name="delivery_date" required />
just use
onSelect
property when you init datepickertry FIDDLE
U can use
onClose
in datepickerjsfiddle - example
You might be able to validate it using date.js, it has a fluent API which makes it very easy to express your conditions.
Example code might be:
Test plunker