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.

jsfiddle


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

reactjs - React router and this.props.children - how to pass state to this.props.children -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -