URL field + relative (local) URL's?

I know it’s probably an HTML url input type validation issue, but I’ll ask it anyway: is it possible to add a relative url in the url field (e.g. /en/page/subpage)?

This is the regex pattern used by the validator

$regex = '_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iu';

So, a relative URL wouldn’t validate.

Thx for figuring out the Kirby validation part too.

Hmmm, so it’s both a “HTML5 input type:url” issue and a Kirby issue to validate local URL’s.
To get this kind of functionality it would require a custom field then, is that right?

Yes, I think so. But wouldn’t it make sense to use a page field instead of a manual input field? Or do you need to explicitly link to pages in another language?

My use case is a “quick links” section in a side bar.

Each link can either be “on-site” (in the same language) or “off-site”.
So basically each link can be a “url field”-item or a “page field”-item, and I was wondering if there was some kind of field that unites both in a good way.

How about “abusing” the builder field? For external URLs, use a URL field, for internal, a page field?

Yes, might be an option. I’ll have a look it.

Thanks!