• Resolved ariasbros

    (@ariasbros)


    Client-side validation message won’t be shown for date fields. This can be solved by moving the script tag after the span tag that holds the message. This could also happen to color fields, but I haven’t tried those.

Viewing 1 replies (of 1 total)
  • Plugin Author Saravana Kumar K

    (@mycholan)

    Thanks I will release the fix with my next release. until then if you want please update your wc-fields-factory/assets/js/wcff-client.js file with the following snippet.

    LN : 333

    this.doValidate = function( field ) {			
    			if( field.attr("wccpf-type") !== "radio" && field.attr("wccpf-type") !== "checkbox" && field.attr("wccpf-type") !== "file" ) {
    				if(field.attr("wccpf-type") !== "select") {
    					if( this.doPatterns( field.attr("wccpf-pattern"), field.val() ) ) {						
    						field.nextAll('.wccpf-validation-message:first').hide();
    					} else {						
    						this.isValid = false;
    						field.nextAll('.wccpf-validation-message:first').show();
    					}
    				} else {
    					if (field.val() !== "" && field.val() !== "wccpf_none") {
    						field.nextAll('.wccpf-validation-message:first').hide();
    					} else {
    						this.isValid = false;
    						field.nextAll('.wccpf-validation-message:first').show();
    					}
    				}							
    			} else if( field.attr("wccpf-type") === "radio" ) {				
    				if( field.closest("ul").find("input[type=radio]").is(':checked') ) {
    					field.closest("ul").next().hide();
    				} else {
    					field.closest("ul").next().show();
    					this.isValid = false;					
    				}	 			
    			} else if( field.attr("wccpf-type") === "checkbox" ) {			
    				var values = field.closest("ul").find("input[type=checkbox]:checked").map(function() {
    				    return this.value;
    				}).get();
    				if( values.length === 0 ) {
    					field.closest("ul").next().show();
    					this.isValid = false;
    				} else {						
    					field.closest("ul").next().hide();
    				}			
    			} else if( field.attr("wccpf-type") === "file" ) {				
    				if( field.val() == "" ) {
    					field.nextAll('.wccpf-validation-message:first').show();
    					this.isValid = false;
    				} else {
    					field.nextAll('.wccpf-validation-message:first').hide();
    				}									
    			}
    		}
Viewing 1 replies (of 1 total)

The topic ‘Datepicker Client Side Validation not working’ is closed to new replies.