php - Disabling selection of dates before specific date -
i want when user selects start date , end date dates before start date selected become disable in end date. using html5 input type=date
this. how can achieve task?
you should validate things on server-side level too, without seeing code it's kind of hard guess looks like.
however, can use attribute min="yyyy-mm-dd"
specify first valid day, , likewise max="yyyy-mm-dd"
maximum available day select.
you can use javascript modify on fly, example
<input type="date" id="start" name="start" onchange='var end = document.getelementbyid("end"); end.setattribute("min", this.value); end.value = (this.value);' /> <input type="date" id="end" name="end" />
this set attribute min
of id="end"
value selected of id=start
.
Comments
Post a Comment