Class bbq.gui.form.validator.MustEqualFieldValidator
Defined in: MustEqualFieldValidator.js.
Ensures that the field value is the same as the field passed the constructor
var field1 = new bbq.gui.form.TextField({value: "foo"});
var field2 = new bbq.gui.form.TextField();
field2.addValidator(new bbq.gui.form.validator.MustEqualFieldValidator(field1));
field2.setValue("bar");
// throws an exception
field2.getValue();
field2.setValue(field1.getValue());
// will not throw an exception
field2.getValue();
Class Summary
Constructor Attributes |
Constructor Name and Description |
|
Ensures that the field value is the same as the field passed the constructor
|
Method Summary
Method Attributes |
Method Name and Description |
|
Validates the passed value.
|
Constructor Detail
bbq.gui.form.validator.MustEqualFieldValidator(field)
Parameters:
Name |
Type |
Comment |
field |
|
|
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.