Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #10033574
    Robcar10
    Participant

    Hello,

    1st, I would like to thank you for the time and solutions you guys provided on my previous ticket.

    After making all changes, everything works. Today I was pointed out that the form can be submitted even if no weeks are checked off.

    I check my HTML code and I do have the require function on each checkbox select.

    Could you please revise it please?

    Thank you!



    Template Version: 7.5.0
    #10033577
    Support
    Keymaster

    Hello,

    Great!

    Try the following:

    First change the code of “No White Space” rule at “view.contact.js” to:

    // No White Space
    $.validator.addMethod("noSpace", function(value, element) {
    	console.log( $(element).attr('data-plugin-multiselect') );
    	if( $(element).attr('required') && typeof $(element).attr('data-plugin-multiselect') == 'undefined' ) {
    		return value.search(/[a-zA-Z0-9À-žа-яА-ЯёЁα-ωΑ-Ω\s\u0621-\u064A\u0660-\u0669 ]/i) == 0;
    	}
    
    	return true;
    }, 'Please fill this empty field.');

    Add the ignore option in the recaptcha v3 code:

    /*
    Contact Form: reCaptcha v3
    */
    $('.contact-form-recaptcha-v3').each(function(){
    	$(this).validate({
    		ignore: [], 
    		rules: {
    			creditcard: {
    ..
    ....
    ....

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads


    #10033611
    Robcar10
    Participant

    So I forgot to reply to this.

    I copied the code as indicated but it seem to not have solve the issue. Form can still be submitted with out any selections of weeks.

    Thanks for the help!


    #10033612
    Support
    Keymaster

    Hello,

    I inspected your code now and it’s wrong in the recaptcha v3 part of code.

    You have:

    /*
    	Contact Form: reCaptcha v3
    	*/
    	$('.contact-form-recaptcha-v3').each(function(){
    		$(this).validate({
    			rules: {
    				creditcard: {
    					ignore: [], 
    					required: true,
    					creditcard: true
    				}
    			},

    And the correct is like I mentioned in my previous reply.

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads


    #10033616
    Robcar10
    Participant
    This reply has been marked as private.
    #10033617
    Robcar10
    Participant
    This reply has been marked as private.
    #10033628
    Support
    Keymaster

    Hello,

    To remove the required from specific fields (with select2) please change the ignore: [] in the JS file to:

    ignore: '.ignore-this-class',

    And in the fiels (select2) you want to ignore add the class ignore-this-class, for example:

    <select class="form-control populate ignore-this-class" multiple="multiple" data-plugin-multiselect................

    Please try that and let us know if you need further assistance.

    Kind Regards,

    Rodrigo.


    If you are satisfied with EZY HTML and our support, please leave your comment and rating on ThemeForest downloads page. That helps us a lot: https://themeforest.net/downloads


    #10033635
    Robcar10
    Participant
    This reply has been marked as private.
    #10033639
    Support
    Keymaster

    Hello,

    I guess what im trying to say is: If a parent is trying to sign up their kid to camp, they must select a minimum of one week, regardless of which camp they select, but at the same time, we don’t want to receive any forms without any weeks selected.

    Probably is possible make that with some custom JS code, by add/removing the ignore-this-class from fields when at least one select option is selected. But unfortunately this is out of our support can offer, since this is more complicated to do and will require too much time to accomplish. This is based on ThemeForest support policy. We hope you understand!

    But probably my tip above regarding custom JS is the best way to accomplish that. We hope this helps!

    If you have any further questions feel free to contact us.

    Kind Regards,

    Rodrigo.


Viewing 9 posts - 1 through 9 (of 9 total)

This topic is marked as "RESOLVED" and can not rceive new replies.