X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/c930e9176a5a85509c5b0230e2bff5c22a591432..10a866c12701c0a0afd0ac85dcdcf32a421514ac:/docs/source/TextField.html?ds=sidebyside diff --git a/docs/source/TextField.html b/docs/source/TextField.html index d32d2e97..c4cc7f8b 100644 --- a/docs/source/TextField.html +++ b/docs/source/TextField.html @@ -1,5 +1,6 @@
+Validation
- *Field validation is processed in a particular order. If validation fails at any particular - * step the validation routine halts.
+ *The validation procedure is described in the documentation for {@link #validateValue}.
+ *Alter Validation Behavior
+ *Validation behavior for each field can be configured:
*If a field is configured with a {@link Ext.form.TextField#validator validator}
function,
- * it will be passed the current field value. The {@link Ext.form.TextField#validator validator}
- * function is expected to return boolean true if the value is valid or return a string to
- * represent the invalid message if invalid.
Basic validation is affected with the following configuration properties:
- *- * Validation Invalid Message - *- *{@link Ext.form.TextField#allowBlank allowBlank} {@link Ext.form.TextField#emptyText emptyText}
- *{@link Ext.form.TextField#minLength minLength} {@link Ext.form.TextField#minLengthText minLengthText}
- *{@link Ext.form.TextField#maxLength maxLength} {@link Ext.form.TextField#maxLengthText maxLengthText}
- *
Using VTypes offers a convenient way to reuse validation. If a field is configured with a
- * {@link Ext.form.TextField#vtype vtype}
, the corresponding {@link Ext.form.VTypes VTypes}
- * validation function will be used for validation. If invalid, either the field's
- * {@link Ext.form.TextField#vtypeText vtypeText}
or the VTypes vtype Text property will be
- * used for the invalid message. Keystrokes on the field will be filtered according to the VTypes
- * vtype Mask property.
Each field may also specify a {@link Ext.form.TextField#regex regex}
test.
- * The invalid message for this test is configured with
- * {@link Ext.form.TextField#regexText regexText}
.
Validation behavior for each field can be configured:
{@link Ext.form.TextField#invalidText invalidText}
: the default validation message to
* show if any validation step above does not provide a message when invalid{@link Ext.form.TextField#maskRe maskRe}
: filter out keystrokes before any validation occurs{@link Ext.form.Field#validateOnBlur validateOnBlur}
,
* {@link Ext.form.Field#validationDelay validationDelay}
, and
* {@link Ext.form.Field#validationEvent validationEvent}
: modify how/when validation is triggeredA custom validation function to be called during field validation ({@link #validateValue}) * (defaults to null). If specified, this function will be called first, allowing the - * developer to override the default validation process. This function will be passed the current - * field value and expected to return boolean true if the value is valid or a string - * error message if invalid. + * developer to override the default validation process.
+ *This function will be passed the following Parameters:
+ *value
: Mixed
+ * This function is to Return:
+ *true
: Boolean
+ * true
if the value is validmsg
: String
+ * Validates a value according to the field's validation rules and marks the field as invalid + * if the validation fails. Validation rules are processed in the following order:
+ *A validator offers a way to customize and reuse a validation specification.
+ * If a field is configured with a {@link #validator}
+ * function, it will be passed the current field value. The {@link #validator}
+ * function is expected to return either:
+ *
If the {@link #validator}
has not halted validation,
+ * basic validation proceeds as follows:
{@link #allowBlank}
: (Invalid message =
+ * {@link #emptyText}
){@link #allowBlank}
, a
+ * blank field will cause validation to halt at this step and return
+ * Boolean true or false accordingly.
+ * {@link #minLength}
: (Invalid message =
+ * {@link #minLengthText}
){@link #minLength}
+ * specified, validation halts.
+ * {@link #maxLength}
: (Invalid message =
+ * {@link #maxLengthText}
){@link #maxLength}
+ * specified, validation halts.
+ * If none of the prior validation steps halts validation, a field
+ * configured with a {@link #vtype}
will utilize the
+ * corresponding {@link Ext.form.VTypes VTypes} validation function.
+ * If invalid, either the field's {@link #vtypeText}
or
+ * the VTypes vtype Text property will be used for the invalid message.
+ * Keystrokes on the field will be filtered according to the VTypes
+ * vtype Mask property.
If none of the prior validation steps halts validation, a field's
+ * configured {@link #regex}
test will be processed.
+ * The invalid message for this test is configured with
+ * {@link #regexText}
.