Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
javascript:plugins:formvalidation [2017-02-22 13:38] adminjavascript:plugins:formvalidation [2023-10-26 20:08] (current) – external edit 127.0.0.1
Line 6: Line 6:
       * ''$(form).formValidation('revalidateField', fieldName);''       * ''$(form).formValidation('revalidateField', fieldName);''
       * http://formvalidation.io/examples/field-value-changed-programmatically/       * http://formvalidation.io/examples/field-value-changed-programmatically/
-  +    Form is not reset if not visible: this causes issues with hidden modal 
 +      * Solution: add resetForm to ''on('hide.bs.modal''' 
 +      * <Code:javascript linenums:1>$('#modalDetails').on('hide.bs.modal', function (event) { 
 + $("#modalForm").formValidation('resetForm', true); 
 +});</Code> 
 +        * See https://github.com/formvalidation/support/issues/144 
 +    * If validation added with HTML5 data-attributes, add additional validation with 'addField'
 +      * Example: reizen3.krisphilippe.be/redirect/trip.php <Code:javascript linenums:1>$('#modalForm-2').formValidation('addField', 'hotel_checkin',
 + validators:
 + remote: { 
 + url:'/ajax/getdata.php', 
 + data: function(validator, $field, value) { 
 + // validator is FormValidation instance, $field is the field element, value is the field value 
 + // Return an object 
 + return { 
 + hotel_checkout: $('input[name="hotel_checkout"]').val(), 
 + request: 'validate_hoteldates' 
 +
 +
 +
 +
 +});</Code> 
 +    * Date 
 +      * is only checked if ''type="date"'' or ''data-fv-date="true"'' 
 +      * default format = ''MM/DD/YYYY'', use ''data-fv-date-format="YYYY-MM-DD"'' 
 +      * ''min='' and ''max='' is not supported (use ''data-fv-date-min='' and ''data-fv-date-max=''
 +      * See http://formvalidation.io/validators/date/ 
 +  * Issues 
 +    * Bug [[https://github.com/formvalidation/support/issues/|#724]]: jQuery 3.0 replaced jqXHR.success(), jqXHR.error() with  jqXHR.done(), jqXHR.fail() 
 +      * Fix: {{ :javascript:plugins:formvalidation.min.js.zip |}}