[html-formfu] How do I constrain a field that's not required?

Carl Franks fireartist at gmail.com
Sat Sep 1 21:42:23 GMT 2007


On 01/09/07, Barry Hoggard <bhoggard at gmail.com> wrote:
> I have a form with an optional URL field.  How do I constrain that to
> be a valid URL, but only if the user enters something?  I don't want
> it to be required.

All constraints should pass if the value is missing or the empty
string - if it doesn't, it's a bug.

The Regex constraint docs have an example for matching a URL.

Carl



More information about the HTML-FormFu mailing list