We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 43592
    • 97 Posts
    Hi Forum members,

    I've a formit call which also validates fields:

    [[!FormIt?
       &hooks=`spam,email,redirect`
       &emailTo=`xxx`
    &emailBCC=`[[+fi.email]]`
    &emailSubject=`Anfrage über die Website`
       &redirectTo=`37`
       &validate=`vorname:required,nachname:required,
          email:email:required`
         
    
    ]]


    When the validation comes into action, my datepicker field, which isnt much more than a text field, looses its date / steps back to the initial date, which is wrong then, but it :

     <div class="datepicker" style="margin-left:15px;text-align: left !important;">[[!DatePicker]]<input style="text-align: left !important;" type="text" id="anreisetag" name="anreisetag" value="[[!+fi.anreisetag]]">
            <script type="text/javascript">
                $(function(){
                    $('*[name=anreisetag]').appendDtpicker({
                        "dateOnly": true,
                         "locale": "de",
                        "dateFormat": "DD.MM.YYYY",
                        "futureOnly": true
                    });
                });
            </script>


    So my question is how can I get the text field remembering the value and not set it back to the initial value after validation?
    Maybe there is a simple possibility within formit ..

    This question has been answered by sspind. See the first response.

    • discuss.answer
      • 43592
      • 97 Posts
      After getting some fresh air I found that simple solution:

      "autodateOnStart": false
        • 42042
        • 140 Posts
        I use this one on a few projects now and had 0 problems: http://foundation-datepicker.peterbeno.com/example.html
          • 43592
          • 97 Posts
          Wow, this one is really nice - thank you!