1
I am using HTML 5 type date, for the user to provide a date.
<input type="date" name="data-inicial">
<input type="date" name="data-final">
There are two fields: Start date and End date, but the end date has to be no more than 29 days after the start date. That is, if personnel select the initial date of 07/23/2018, it has an interval of no more than 29 days after that date, to select the final date.
You can pick the initial date, which the user informed, sum 29 days and set as final date value. Try to do so?
– Woss
But I do not want to set a final date, I want to prevent the person from selecting a date above the 29 days of the initial date, have as?
– P Ribeiro
Yes, the logic is the same as I mentioned: just add 29 days to the start date with Javascript and define it as the end date, but your question is not clear. Please edit and add HTML.
– Woss
I edited it, take a look now
– P Ribeiro
So, with what I commented before you can do this. You can set the maximum date through the attribute
max
. Try it like this, I’ll make sure it works and it’s easy.– Woss
I leave the min blank and the max with 29?
– P Ribeiro
No, stick to the terms: sum 29 days - including put as a link to where explains how to do.
– Woss