Hi,
I have a custom field which field type is URL. Every time I start typing in this textbox it will show the previous URL I typed before. Can I deactivate this function?
Hello,
There isn't such kind of built-in feature within Toolset Types plugin, it is a feature of your browser, to order to disable it, it needs to add autocomplete="off" attribute into the HTML input box, for example:
<input name="q" type="text" autocomplete="off"/>
More help:
hidden link
So you will need to consider custom codes, for example, register a JS file in your website admin side:
https://developer.wordpress.org/reference/hooks/admin_enqueue_scripts/
In the JS file, setup custom JS codes to add the attribute: autocomplete="off"
hidden link
I tried <p>[types field='cf-url' target='_blank' autocomplete="off" ][/types]</p>, it doesn't work.
does it have to be JS file? Is it any other option like create a code snippet?
to the JS file link you sent me, I don't find my answer from there. They do have a lot of examples, but I still don't know what to write into my script.
Can this solution apply to my question? https://toolset.com/forums/topic/autocomplete-off/ If yes, Is this the whole code to paste into the JS file?
Yes, it needs to use JS file to add HTML attribute autocomplete="off".
The solution you mentioned above is for CRED form, it won't work in your case.
Since it is a custom codes problem, if you need more assistance for it, please provide a test site, fill below private message box with login details, also point out:
1) The problem page/post URL
2) The custom URL field name
3) Where I can edit your PHP codes
Thanks for the detail, it is a Toolset post form, so you can setup the JS codes directly.
I have done below modifications in your website:
Edit the post form: Form New Unwraps
hidden link
Click "JS Editor", add below codes:
jQuery(document).on( 'cred_form_ready' , function () {
jQuery( 'input[name="wpcf-cf-url"]' ).attr( 'autocomplete', 'off' );
});
Please test again, check if it is fixed, thanks
Brilliant, now I know where to edit the JS file. Appreciated.