Hey @arthrnvrn – Thanks for reaching out!
To disable copy/paste on the email field, you can use following code snippet:
function wpf_dev_prevent_copy_paste( ) {
?>
<script type="text/javascript">
jQuery(document).ready(function () {
// Update the form ID to match your own form ID
jQuery('form#wpforms-form-70').on('copy paste', 'input', function (e) { e.preventDefault(); });
// Uncomment this snippet if you want to prevent this on your entire website
// jQuery('body').on('copy paste', 'input', function (e) { e.preventDefault(); });
});
</script>
<?php
}
add_action( 'wpforms_wp_footer_end', 'wpf_dev_prevent_copy_paste', 30 );
In the above code, you’ll have to update the form ID 70 to match your own.
In case it helps, here’s our tutorial with the most common ways to add custom code like this.
For the most beginner-friendly option in that tutorial, I’d recommend using the Code Snippets plugin.
Kindly,
-
This reply was modified 2 years, 1 month ago by
Prashant Rai.