Block typing in date field

Asked

Viewed 465 times

1

Has as Block typing field date and keep up to popup who carries the calendar?

The problem is this:

<input type='date' id='data' name='data' max="<?php echo date('Y-m-d'); ?>" required  />

I added deadline at the input date.

When the user chooses in the calendar to date, there, the later dates à deadline are deactivated to the selection. However, if the user resolve type to date instead of choosing her in calendar, then he will achieve type a later date à deadline.

Like circumvent that problem?

  • You are using which plugin to open this calendar?

  • none. is that of HTML5 itself

  • Your intention is to block using html?

  • <input type='date'

  • if possible. Or if there is a way not to allow typing of later dates also solves. But the goal would be HTML itself

  • You know that if you only do this in html it is easily scammed, since when the page is loaded on the machine on the user it can do whatever you want with it, ideally you check it after the request in php, so the user will not have any access and so you will make a more effective lock.

  • I know, but I wanted to do two sides]

  • You use Jquery?

  • yes. used yes

  • 2

    An example that solves your https://jsfiddle.net/jo8sq0t4/ problem if your question is reopened I put this code as the answer.

  • 1

    solved, thank you very much

Show 7 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.