---
name: "HTML::FormFu::Element::URL"
section: "3pm"
platform: "linux"
package: "libhtml-formfu-perl"
version: "2.07000-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/HTML::FormFu::Element::URL"
---

# HTML::FormFu::Element::URL(3pm)

HTML5 URL form field

## NAME

HTML::FormFu::Element::URL - HTML5 URL form field

## VERSION

version 2.07

## SYNOPSIS

```
    my $element = $form->element( URL => 'foo' );
    # no need to add a separate constraint
```

## DESCRIPTION

HTML5 URL form field which provides native client-side validation in modern browsers.

Creates an input field with `"<type="url""`\>.

Also sets the `"pattern"` attribute to restrict the client-side validation to only our desired schemes (http and/or https).

This element automatically adds a Regex constraint, so you don't have to.

If neither "http\_only" or "https\_only" are set, the constraint allows any HTTP or HTTPS url.

## METHODS

### http\_only

### https\_only

### message

Arguments: `$string`

Set the error message on the Regex constraint which is automatically added.

### message\_xml

Arguments: `$string`

If you don't want your error message to be XML-escaped, use the "message\_xml" method instead of "message".

### message\_loc

Arguments: `$localization_key`

Set the error message using a L10N key.

## SEE ALSO

Is a sub-class of, and inherits methods from HTML::FormFu::Role::Element::Input, HTML::FormFu::Role::Element::Field, HTML::FormFu::Element.

HTML::FormFu

## AUTHOR

Carl Franks, `"cfranks@cpan.org"`

## LICENSE

This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.

## AUTHOR

Carl Franks \<cpan@fireartist.com\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2018 by Carl Franks.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
