• Resolved hsntgm

    (@hsntgm)


    Hello codepeople !

    I tried to do that with my own logic.This is maybe another historical moment (disaster:)) for you software developers ?? Laugh free..

    
    <script>
    jQuery(document).on(
    'click', 
    '[id*="fieldname143_"]', function () {
    	var errorCount = 0;
    	var first = '[id*="fieldname' ; //string
    	var counter = '0' ;             //string  !! I am not sure this string will be integer in for loop
    	var second = '_"]' ;	         //string
    	var id = first + counter  + second ;    //sum side by side output == [id*="fieldname0_"]
    		
    		for (counter = 0; counter < 300; counter++ ) { //now it is integer 
    			if (jQuery('id').each().hasClass('.field.cpefb_error:visible')) {
    			errorCount = errorCount+1
    			Query( '.myclass .uh').html(' Please fill in ' + errorCount + 'missing information.');
    			} 		
    		}	
    });
    </script>
    

    Best Regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello,

    Your code is too complex with no reason. The following option is more straightforward:

    <script>
    jQuery(document).on(
    	'click',
    	'[id*="fieldname143_"]', function () {
    	var counter = jQuery('.field.cpefb_error').length;
    	if(counter)
    		Query('.myclass .uh').html(' Please fill in ' + counter + 'missing information.');	
    });
    </script>

    Best regards.

    Thread Starter hsntgm

    (@hsntgm)

    I am jealous of you. How much do I have to pay to get a private one year jquery camp ??

    As usual, your solution works and mine doesn’t work at least don’t break form layout:) This is my success story..

    Best regards,

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘count the form valitadion errors and print output to html’ is closed to new replies.