Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the common Flex verification methods?

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the commonly used Flex verification methods, which have a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to know about it.

Common Flex verification methods

Required for 1.Flex verification

The code is as follows:

The function of the Validator component is to detect required items. We write the name of the component to be detected in the source property, write the property of the component to be detected in the property property, and then customize the value of the requiredFieldError property. Of course, the value of the requiredFieldError attribute may not be defined, so the default prompt text will be used.

The above error prompt text is somewhat illegible, just add this sentence to OK:

.errorTip {fontSize:12;}

two。 Control the timing of testing

By default, Flex detects any action to trigger verification when we switch the focus of the component. There are two ways of Flex authentication. One is to specify triggers and trigger actions in the validation component. The other is to execute event handlers.

The syntax for indicating triggers and triggering actions in the validation component is as follows.

The following example is that pressing the Tab key to change the focus can no longer trigger the detection action, only clicking the "submit" button will trigger the detection.

By default, Validator detects when the Flex emits a valueCommit event, so it detects automatically when the focus changes. In the source code above, it is manually specified that the detected event is the click event of the btn button.

Any action can also be triggered by code-triggered Flex verification.

The syntax is as follows.

The validation components all contain a validate method that the code uses to perform validation.

For example:

Thank you for reading this article carefully. I hope the article "what are the common Flex verification methods shared by the editor is helpful to everyone?" at the same time, I also hope that you will support and pay attention to the industry information channel, and more related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report