The DQE E-mail plugin triggers several events at runtime so that it can interact with the form during processing. This allows you to display a status message or a wait animation when scanning the email address.
Checking event
This event is triggered just before you start verifying an email address. It allows you to display text or an animated image when the user is waiting.
Example:
dqemail.on("checking", function() {
$('#my_email_state').html("Loading...");
Checked event
This event is triggered when the email address is verified. It allows you to display the result of the analysis or even format the field accordingly.
Example:
dqemail.on('checked', function(ui, data) {
$('#my_email_state').html(data.msg);
});
The checked event returns a "data" dictionary that contains the following keys:
- "code": return code of the call to the DQE server.
- "msg": message formatted in French detailing the return code.
- "state": status linked to the return code among the following choices:
- "success"
- "warning"
- "error"
Special cases related to the use of Bootstrap
If the BootStrap Framework is used to encode your HTML pages, the DQE E-mail library provides all the code necessary to display icons and change the color of the field in accordance with the 3 available validation styles:
- "success"
- "warning"
- "error"