i am new to html and p-h-p. what i am looking for is that i have provided user an input date calendar through html date input method. Now how can i detect that user have provided date or not ... if he didn't selected date from calendar he should be get an alert to please provide date... the problem i'm facing is if user is not selecting a date so the value of "date-from" which is the "value" of input date is setting to default date automatically. by default i mean least date. i should be very much thankful if anyone can help ...
Why can't we just use the HTML5 required?
<input type="date" name="date" required>
I would suggest you used JavaScript for this purpose instead. By doing that you will be able to keep it client sided and the user don't have to refresh the page to validate.
Pls have a look at "onblur" event or just "onsubmit" in JavaScript