Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4218 (ok 4.1.6) Chrome behavior with date fields

4.1.3
fixed
Marc Delisle
1
2014-01-26
2014-01-06
Marc Delisle
No

Since phpMyAdmin 4.1, there is a problematic behavior with date fields (insert or edit) under Chrome. For screenshots and details, see

http://stackoverflow.com/questions/20928019/how-to-defeat-input-field-formatting

Discussion

  • I just commented on your SO question but will repeat it here. I think this is an issue with Chrome rather than phpmyadmin. Try reporting the issue here: https://code.google.com/p/chromium/issues/list

     
  • Ann + J.M.
    Ann + J.M.
    2014-01-15

    • labels: --> html5, browser, chrome
     
  • Marc Delisle
    Marc Delisle
    2014-01-16

    J.M.
    how about adding a checkbox to the bottom section (next to Go/Reset) that would deactivate the HTML 5 input tag enhancements?

    Could also be a new setting, but having the checkbox near where we need it, is a plus.

     
  • Marc,
    We can automatically change type to 'text' if chrome browser is detected. So it will fallback to datepicker. How is that option sounds ?

     
  • Marc Delisle
    Marc Delisle
    2014-01-19

    Viduranga,
    I'm not sure what is the best option. Using the new "date" type has its advantages (for example, showing the date format for correct insertion and date validation).

     
  • validation is also done via datepicker.

     
    • Marc Delisle
      Marc Delisle
      2014-01-19

      But using the datepicker is optional.

       
  • ahh okay. But I didn't use it. I think datepicker already there even with the type 'date'. what I did was only change input type to text. nothing else.It still validates properly without type 'date'

     
    • Marc Delisle
      Marc Delisle
      2014-01-19

      In my tests, with type "text", I can enter "2014-14-01" and there is no validation.

       
  • Strange. I tried that same value and validation failed. Plese see the screenshot

     
    Attachments
    • Marc Delisle
      Marc Delisle
      2014-01-19

      Your screenshot shows a server-side validation, but the goal of the "date" input type is client-side validation. Try it with Chrome and the "date" input type.

       
  • Yeah that modal box is server side validation. But it also does client side validation. See the below screenshot. I think it's client side validation. Isn't it ?

     
    Attachments
    • Marc Delisle
      Marc Delisle
      2014-01-19

      Yes, this is client-side (done with verificationsAfterFieldChange() from js/tbl_change.js ) but you are still able to enter an incorrect date. After submission, in my tests, a value of "0000-00-00" is stored.

      In Chrome, with the "date" input type, the validation is more active. For example, a month value of 14 is automatically changed to 12.

       
    1. In mine no value is stored if validation fails

    2. In firefox incorrect month values won't get corrected automatically (For example, a month value of 14 won't automatically changed to 12.). So I think that feature is available only in chrome.

    3. But according to "http://stackoverflow.com/questions/20928019/how-to-defeat-input-field-formatting" people want to copy and paste date into the box. But with chrome's 'date' type it's not possible at all. It wouldn't let any full date to be paste into.

     
  • Marc Delisle
    Marc Delisle
    2014-01-19

    Indeed, this seems to be supported only by Chrome at the moment. We have to make the best possible decision for the whole community, that's why I suggested in the thread above to keep this validation, but to give a quick way to disable it for users like the one who wants to paste.

     
  • yes. We can do that. But users need to be well informed about this ,otherwise it won't be any use.

     
  • Marc,
    So shall I introduce a checkbox to disable the html5 date validation like you said or is it still under discussion ?

     
    • Marc Delisle
      Marc Delisle
      2014-01-20

      Viduranga,
      I sent to phpmyadmin-devel a request for comments about this.

       
  • Marc Delisle
    Marc Delisle
    2014-01-22

    • assigned_to: Marc Delisle
     
  • Marc Delisle
    Marc Delisle
    2014-01-22

    • summary: Chrome behavior with date fields --> (ok 4.1.6) Chrome behavior with date fields
    • status: open --> resolved
    • Priority: 5 --> 1
     
  • Marc Delisle
    Marc Delisle
    2014-01-26

    • Status: resolved --> fixed