Share via


Validation (fx.validation.js) Common Control Service

 

Applies To: Windows Azure Pack

fxValidation and fx.validators validate controls with a set of included validator rules or with rules you create. Includes validation that calls a web service to check validity.

Note

The validation logic and the set of pre-built validators are in different files

Windows Azure Pack fxValidation

Widgets

$("Selector").fxValidation()

Properties

Name

Type

Description

fx.fxValidation.options.container

String

String or jQuery element indicating the container of the control on which submit can happen. It is recommended you use a form tag. You can also use any other tag that can listen to a submit event. If you don't set this value, the closest form tag is searched.

fx.fxValidation.options.validateOnSubmit

Boolean

Triggers the validation on submit.

fx.fxValidation.options.withBalloon

Boolean

Indicates to show the balloon if a validation fails.

fx.fxValidation.options.withErrorPlacement

Boolean

If a validation fails, indicates whether to show the error with the element.

Methods

Name

Description

Returns

Parameters

fx.fxValidation.destroy

Destroys the widget.

Nothing

None

fx.fxValidation.getElementId

Gets the element ID. If the id didn't exist beforehand, an ID is automatically created.

String

None

fx.fxValidation.getState

Gets the current state of all the validators. See Shell.UI.Validation.getValidationStateName for more details.

String

None

fx.fxValidation.resetValidation

Resets the validation on the element.

Nothing

None

fx.fxValidation.revert

Reverts the current state and revert it back to the original.

Nothing

None

fx.fxValidation.showValidationBalloon

Shows the validation balloon.

Nothing

None

fx.fxValidation.validate

Executes validations on element. See Shell.UI.Validation.getValidationStateName for more details.

String

showRequiredErrors (Boolean): Whether to show error related to required validations. Default is true.

executeImmediately (Boolean): Whether to execute any delayed validations immediately. Default is true.

elementValue (Object): The value to use to validate the input for any validations to be run immediately. Pass a value here if the value currently in the element is not the one you want to validate again (for example during a keypress event). If not supplied the value will be read from the element.

See Also

Windows Azure Pack Extension Common Control Services
Windows Azure Pack Management Portal User Interface Extensions