Thank you for your patience! There is a known bug when using cache compatibility mode and obfuscating together, specifically:
Note: obfuscated values inserted via JavaScript don’t appear to the user as intended. The functionality works and saves obfuscated in the database so emails, storage, and hidden fields are not affected. Only visible form fields that are intended to be read by humans are affected in that they show the obfuscated mumbo jumbo instead of the human-readable format.
If this particular email input field isn’t visible to the user, it should be fine and not affect functionality at all.
input
fields behave similarly to code
and pre
elements in that if the value was encoded, it displays it as-is rather than rendering it as HTML.
For security purposes, the plugin intentionally does not decode values before inserting—it could potentially allow bad actors to insert malicious code into your form. However, for your use-case scenario, you can add a listener to the dtx_init
javascript event that runs on the element after it’s been initialised. For example:
let wpcf7dtxel = document.querySelector( '.wpcf7dtx' );
wpcf7dtxel.addEventListener( 'dtx_init', function( e ) {
console.info('DTX field initialised', e); // Delete me later, for testing purposes
// Get the current input element
let input = e.currentTarget; // The input element
// TO-DO: optionally do some checks to verify this is the email field and not some other field
// Decode value
value = decodeURIComponent( input.getAttribute( 'value' ) );
// TO-DO: optionally validate the value to ensure it is an email address and not something else
// Set value of input field
input.setAttribute( 'value', value );
} );
Note: this code is untested as I wrote it directly here in the response ??
Please let me know if this works!