• Resolved olumiide

    (@olumiide)


    Hello Team
    I have been trying to disable copy and paste on all field
    I tried using this code but it does not seems to work:


    <script>
    document.getElementById("field_conf_FIELDKEYHERE").addEventListener('paste', e => e.preventDefault());
    </script>

    Inserted the field key in the field area but this didn’t solve the issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @olumiide,

    To disable copy/paste, use the following jQuery code and make sure to replace the form ID (#frm_form_1_container) with your own form ID. This code will prevent copying and pasting, including right-clicking.

    jQuery(document).ready(function($) {
        $('#frm_form_1_container input, #frm_form_1_container textarea').on('copy paste', function(e) {
            e.preventDefault();
        });
    
        $('#frm_form_1_container input, #frm_form_1_container textarea').on('contextmenu', function(e) {
            e.preventDefault();
        });
    });

    Preview:

    Give it a try and let me know how that goes! ??

    Plugin Support Njones35

    (@njones35)

    Hi there,

    I’m afraid that we do not have any built-in functionality to disable copy and paste in forms, and I’m afraid our support does not cover custom code.

    Because of this, the solution offered by @faisalahammad is probably your best option.

    Best,
    Nathanael

    Thread Starter olumiide

    (@olumiide)

    Faisal Ahammad?@faisalahammad? Njones35?Thank you
    1. The giphy is not clear
    2. By Form ID do you mean something like this [formidable id=4] or you meant the field key
    I will be glad if you can give me some clarification on this. Thank you

    Hi @olumiide,

    1. Sorry about that. The gif was just for preview. Once you’ve applied the code, you will see the same output.
    2. Certainly! The form ID will serve as a unique identifier that replaces the number 1 in the CSS class frm_form_1_container. For example, if your form ID is 5, you should use frm_form_5_container. Ensure to update this class four times in the code while keeping everything else unchanged.

    Please keep me posted about the outcome. Thank you ??

    Thread Starter olumiide

    (@olumiide)

    Hello Faisal Ahammad?@faisalahammad, this code does seem to work. This is the actual code i want to use:

    jQuery(document).ready(function($) {
    $(‘#frm_form_4_container input, #frm_form_4_container textarea’).on(‘copy paste’, function(e) {
    e.preventDefault();
    });

    $('#frm_form_4_container input, #frm_form_4_container textarea').on('contextmenu', function(e) {
        e.preventDefault();
    });

    });

    I added the code to my WordPress site using custom CSS and js plugin but to no avail
    I executed the code in the console no result still
    Can you inform me of what else you did during this process and i don’t know why the team @Njones35?marked this as resolved already.

    Plugin Support Jonathan Martínez

    (@jonathanenlared)

    Hey @olumiide,

    The conversation was marked as resolved, since we don’t have built-in feature that could help you accomplish your goal and custom code is not supported by our support.

    Our community is a great resource for finding help with custom code. You can post your question on our community site at https://connect.formidableforms.com/. Our community members are knowledgeable and willing to offer assistance.


    Best,
    Jonathan

    Hi @olumiide,

    Can you kindly provide the specific webpage URL so that I can test your form and share customized code that will function smoothly without requiring any alterations?

    The plugin author has certain limitations and their own support policy on this forum. As a volunteer, I am willing to go the extra mile by offering custom code to help you resolve the issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Disable copy and paste on all forms’ is closed to new replies.