Add Event Listener for a Validation

Do you want to do more with the JS Widget? You can do that easily using the below event listener and a little knowledge of JavaScript.

Add the code below before your page’s closing </body> tag. Once the JS Widget does the validation process, the below functions call, and you can do your desired functions. Adding extra features to the JS Widget is easy based on your needs and requirements.

<script>
var _watch = null;
var the_code = null;
setInterval(function() {
    if ( _watch !== the_code ) {
        _watch = the_code;
        //--- Variable (the_code) will get the value of validation results.
        //--- See a list of result codes here: https://bit.ly/dbnccodes
        if (the_code==6){
            alert('Email is invalid. Variable changed: ' + the_code);
        }
        //--- Do some stuff ---
    }
}, 100);
</script>

Was this helpful?