Class bbq.gui.form.validator.URLValidator

Defined in: URLValidator.js.

Ensures that the field contains a valid URL. For our purposes a valid URL has a protocol and a hierarchical part, e.g. prototcol://hierarchical

var field = new bbq.gui.form.TextField();
field.addValidator(new bbq.gui.form.validator.EmailValidator());
field.setValue("foo");

// throws an exception
field.getValue();

field.setValue("http://bar.com");

// will not throw an exception
field.getValue();

Class Summary
Constructor Attributes Constructor Name and Description
 
Ensures that the field contains a valid URL.
Method Summary
Method Attributes Method Name and Description
 
validate(value)
Validates the passed value.

Constructor Detail

bbq.gui.form.validator.URLValidator()

Method Detail

{String} validate(value)

Validates the passed value.
Parameters:
Name Type Comment
value {Object} The value to validate
Returns:
{String} An error code. Returns null if no error occurred.