When using HTML5 date and you have DD/MM/YYYY
is there a way to validate it using PHP so if DD/MM/YYYY
has been left as DD/MM/YYYY
it throughs an error?
I guess you cannot use empty()
as its not empty.
When using HTML5 date and you have DD/MM/YYYY
is there a way to validate it using PHP so if DD/MM/YYYY
has been left as DD/MM/YYYY
it throughs an error?
I guess you cannot use empty()
as its not empty.
HTML5 date inputs will send their value as YYYY-mm-dd
format, but will display whatever format is locale-friendly to the user.
If nothing is entered (ie. the input is "blank"), then nothing is sent.
So, on the server, empty
will work fine.