user120118
user120118

Reputation: 65

Error / Validation / ToolTips in Adobe Flex

Is there any code or custom options available to achieve the following :

1> When an error occurs in a text box, the validation shows the error. Forces the user to remove the error and only then proceed to complete remaining text inputs. KEEPS the mouse focus on the Text Box.

I have used built in mx:Validator tags, but it does not coerce the user to remove the error. Instead, user can easily go ahead without rectifying the error.

2> Can the error message which generally appears as a tooltip when mouse focus moves over the text input with the error, REMAIN until the user removes error and not just be displayed on mouse hover action?

Upvotes: 1

Views: 3297

Answers (3)

Brent
Brent

Reputation: 21

You can customize your ToolTips to show your Error. Check this link to customize your tooltip, to show your error in ToolTips

Upvotes: 2

Phil C
Phil C

Reputation: 980

A solution to question 1) is as follows; Use the Validator.validateAll static method to check that all form items are valid before allowing the form to be submitted. The following snippet is taken from a good flex example which shows this

private function resetForm() :void
{
    btnLogin.enabled = false;
}
private function validateUs() :void
{
    btnLogin.enabled = (Validator.validateAll([val1,val2]).length == 0);
}

The complete example is here http://idletogether.com/easy-form-validation-and-submit-button-enable-disable-in-flex-3/

Upvotes: 0

Chetan S
Chetan S

Reputation: 23803

For #2, check out http://aralbalkan.com/1125.

Unfortunately, it is a lot of hassle if you have multiple/large forms. It is unfortunate flex doesn't provide more styling options for the error tooltip.

#1 seems to be a bad UI design. While you may not allow them to submit a form unless they enter valid information, they should be able to navigate around the form freely and fill in the information as they choose. Just my opinion.

Upvotes: 1

Related Questions