• Resolved thomaslindvig

    (@thomaslindvig)


    1) We have the problem that Google / Safari auto-complete fills in full names in both first name and surname fields, and the user is not aware of it, or doesn’t care.
    Is it possible to insert some jquery that checks for that and then fire an alert about it? We can code the jquery our selves, but do you have some suggestions?

    2) In some fields we need to restrict the input, like a zip number should only be 4 numbers, is that possible?

    3) How do we make zip field required?

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Patrick – WPMU DEV Support

    (@wpmudevsupport12)

    Hi @thomaslindvig

    I hope you are doing well.

    1- I am afraid no, we can’t control the autfill event so it would apply what member has in “name-1” and “name-2”, a solution would be disabling the autofill for those two specific fields.

    2) In some fields we need to restrict the input, like a zip number should only be 4 numbers, is that possible?

    This will require a custom validation, I would suggest using a mask JS for this, this is a simple example:

    <?php
    
    add_action( 'wp_enqueue_scripts', function(){
    
        wp_enqueue_script( 'form-mask', 'https://cdnjs.cloudflare.com/ajax/libs/jquery.maskedinput/1.4.1/jquery.maskedinput.min.js', array('jquery'), false, true );
    
    }, 99 );
    
    add_action('wp_footer', function ()
    { ?>
    <script>
    
    	(function ($) {
    
    		$(function () {
    
    			$(document).on("after.load.forminator", function (e, id) {
    
                	if(id === 1462){
                        $("#address-1-zip input").mask("9999");
                    }
    
                });
    		});
    	})(window.jQuery);
    </script>
    
    <?php
    }
    , 21);

    You just need to make the form load from Ajax and update the ID on the custom code to match your form.

    https://monosnap.com/file/PATyTFw9PWqIf4jO39fZ9SXvhyuDHj

    To install the code you can use it as a mu-plugin: https://wpmudev.com/blog/wordpress-mu-plugins/

    3) How do we make zip field required?

    This can be done in the Settings: https://monosnap.com/file/7ob4XDooLopWs3qbM32b4J1XkPHirU

    Best Regards
    Patrick Freitas

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @thomaslindvig ,

    We haven’t heard from you for over a week now, so it looks like you don’t have any more questions for us.
    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Autocomplete makes errors for visitors’ is closed to new replies.