• Resolved Cécile J.

    (@nvmweb)


    Dear team,
    First thank you for this nice plugin that I really love for its simplicity and good works. is there a way to avoid the integration of url in the form’s replies ? (text fields, name fields, etc.)

    Thank you

    Cécile

    • This topic was modified 1 year, 11 months ago by Cécile J..

    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 @nvmweb

    I hope you are doing well.

    I am afraid it is not possible to remove the URLs, the plugin wouldn’t be able to define if that is an URL or regular text as the text field won’t accept HTML.

    But could you please try this code:

    <?php
    
    add_action( 'wp_footer', function(){ ?>
    <script>
    	(function($) {
    
        $(function() {
    
            $(document).on("after.load.forminator", function(e, id) {
    
                var cvalinput = $('.custom-validate input');
    
                let regx = /(?:https?|ftp):\/\/[\n\S]+/g;
                let clean_value = '';
    
                $(cvalinput).bind('focusout keyup', function() {
                    clean_value = $(this).val().replace(regx, '');
    
                    $(this).val(clean_value);
    
                });
    
            });
        });
    })(window.jQuery);
    </script>
    <?php }, 21); ?>

    Use it as a mu-plugin following this guide https://wpmudev.com/blog/wordpress-mu-plugins/ navigate to your form and use this class custom-validate in the fields that you want to remove links:

    https://monosnap.com/file/cBkmGWyfL6Cu7WonUbp6nubjH0MBRA

    Make sure your form is loading from Ajax:

    https://monosnap.com/file/QCnpvyrE8d5A4xCB9xQEBP6IXsLlxA

    Now it will remove any link if user types it:

    https://monosnap.com/file/qVsCr058QkP9LeVR0CApXblofBXkvQ

    Note, extending this code is out of our support scope, but you can use this as a base to create some extra validations.

    Best Regards
    Patrick Freitas

    Thread Starter Cécile J.

    (@nvmweb)

    Hi Patrick,
    Thank you for your fast and complete reply. Unfortunetly this option is too complicated for me ?? It does’nt matter.
    Have a nice day,

    Cécile

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘prevent the integration of url in the answers?’ is closed to new replies.