jQWidgets Forums

jQuery UI Widgets Forums Editors DateTimeInput Validation Issue foe restricted DateTime Input

This topic contains 4 replies, has 2 voices, and was last updated by  holyeddie 11 years, 2 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author

  • holyeddie
    Participant

    Hi,

    I want to enter a german date (dd.mm.yyyy) into a Date Field.
    The min date is restricted to todays date (14.04.2014).

    It is not possible to enter e.g. 10.10.2014 since the day
    field accepts values >= 14. This makes sense for the english
    date format but not for the german. Is it possible to turn
    the validation of for keyboard entries?

    The restriction in the calender is nice and I would like
    to keep it.

    Thanks!

    Lars


    Peter Stoev
    Keymaster

    Hi Lars,

    The Keyboard entries are validated, too. The validation is automatic and happens on Blur(Focus Lost). When the widget is on focus, you are allowed to enter any date via the keyboard, but when you enter a date below the min date, on blur, the min date would be saved. If you enter a date greater than the max date, the max date would be saved on blur.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    holyeddie
    Participant

    Hi Peter,

    this code gives a min date 15.04.2014. If I want to enter 01.10.2014 it does not work,
    because ’01’ is always set to 15.

    <script type="text/javascript">
      $(document).ready(function () {                
        $("#jqxWidget").jqxDateTimeInput({width: '200', height: '25', culture: 'de-DE', min: new Date(2014, 3, 15)});
      });
    </script>
    <div id='jqxWidget'></div>

    I appreciate your help.

    Best regards
    Lars


    Peter Stoev
    Keymaster

    Hi Lars,

    I understand. The reason is that by entering 01 through the keyboard, the current date would be 01.04.2014 which is out of the validation range. I agree that the logic should be improved and the validation should happen after the user enters the full date. We will do our best to improve that for the future versions. The workaround which I can suggest you is to validate the user input by using the jqxValidator plug-in. Example: http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxvalidator/defaultfunctionality.htm?arctic

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com/


    holyeddie
    Participant

    Hi Peter,

    ok … I already use the jqxvalidator. Unfortunatly this is not a workaround because the data check in the box itself does still happen. It would be nice to have a possibility to disable the data check by the datetime control.

    Best regards
    Lars

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.