Force "initial content" on an input field to remain?

I have a form that requires user to input a URL. I want to ensure that the URL being entered is valid. As such, the URL should be prefixed with “https://”. I can enter “https://” in the “initial content” box - but, the user can wipe it out, if they want to. What’s the best solution for this? Is there a validator plugin of some sort that will check for valid URLs? Or a way to force initial content to stay in place? Any help would be appreciated. Thanks.



Easy peasy. Whenever you go to save or use that input’s value, simply check that it starts with “https://”, and if not, prepend it…


Wow, super easy! Thank you!

1 Like