Created
September 24, 2017 14:27
-
-
Save leadbi/099141dfc88a12af9ab2c9b5a7c9df7a to your computer and use it in GitHub Desktop.
LeadBI Form Events Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=utf-8"> | |
<title>LeadBI Form Events </title> | |
</head> | |
<body onload="_load()" style="height: 2000px"> | |
<h1>LeadBI Form Events</h1> | |
<a href="https://www.leadbi.com/">www.leadbi.com</a> | |
<script src="https://a.leadbi.com/f/14756c13-c169-4f90-b956-319a3c1d2839.js" data-id="14756c13-c169-4f90-b956-319a3c1d2839"></script> | |
<script> | |
function _load() { | |
$leadbi_forms.getForm('14756c13-c169-4f90-b956-319a3c1d2839', function (err, form) { | |
if (err) { | |
window.console.error(err); | |
return false; | |
} | |
// handle error | |
form.on('error', function (data) { | |
window.console.error(data); | |
}); | |
// handle when the form is visibile | |
form.on('open', function (data) { | |
window.console.log(data.view); | |
}); | |
// handle form submit | |
form.on('submit', function (data) { | |
window.console.log(data.data); | |
}); | |
}); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment