Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Powered by Vanilla. Made with Bootstrap.
Copyright by
Please note that access to the support forum is restricted to verified buyers only. To apply for access click here and fill out the form.

Support is offered by this forum only, any other request will be redirected to the forum.
Please read this before you start posting.
input date validate format?
  • Hi Markus,

    What and how i must change for date format change?

    That only User input Date format like is valid for submit form?

    Can you please introduce me what i must edit?

    Thanks for your Time.

  • msiemens
    Hey peisi,

    you should be able to set the date format using the data-date-format attribute (something like <input type="date" data-date-format="">).
    Does it work for you?

  • the date is also not valid =(

    <p class="_25">
                <label for="rythmus_datum">Änderung zum:</label>
                <input type="date" name="rythmus_datum[]" data-date-format="" class="required"/> 


    And jquery.validate.js = 

    date: function( value, element ) {
    return this.optional(element) || !/Invalid|NaN/.test(new Date(value).toString());

    dateISO: function( value, element ) {
    return this.optional(element) || /^\d{1,2}\.\d{1,2}\.\d{4}$/.test(value);

    You have a solution?
  • msiemens
    Hey, you can add your own validation like this:

    $.validator.addMethod("dateDE", function(value, element) {
        return this.optional(element) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test(value);
    }, "Bitte gib ein korrektes Datum an.");

    You then can enable the new rule by setting data-rule-datede:

    <input type="date" name="rythmus_datum[]" data-date-format="" data-rule-datede="true" class="required"/>

    Does this work for you?