URL validation in input field

Can you show a sample code how to validate URL in an input field?

Something like this?

Have you tried setting the type of the input field to URL?

Hey,
I recommend checking out our Validating User Input with the Settings Panel and Validating User Input with Code articles:

Have a good day,
Tal.