Using Event Handler Callbacks

You can register your own JavaScript functions as callbacks when a certain event happens in your survey. Add this code directly beneath the main Qualaroo javascript.

When the survey is displayed

This event is triggered when the survey is displayed.

<script type="text/javascript" charset="utf-8">
_kiq.push(['eventHandler', 'show', function(){     
    // Execute the following function when the survey has appeared
}]);
</script>

 

Example: this will minimize a survey right after its ‘show’ event, so that it appears to load minimized.

<script type="text/javascript" charset="utf-8">
_kiq.push(['eventHandler', 'show', function(){  
    if(this.survey && this.survey.view && this.survey.view.minimize) {    
        this.survey.view.minimize(true);  
    // true tells us not to animate the minimization   
} }]);
</script>


When the survey is closed

This event is triggered when a visitor submits the survey. It will also be triggered if the “close survey when minimized” option is enabled.

<script type="text/javascript" charset="utf-8">
_kiq.push(['eventHandler', 'close', function(){     
    // Execute the following function when the survey has been closed
}]);
</script>

Have more questions? Submit a request
Powered by Zendesk