Use advanced scripting options to control and interact with embedded widgets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<div id="integrifyWidget" style="height:500px; width:800px;"></div>
<script language="javascript" src="https://widgetdemo.integrify.com/integrify/integration/loader.js"></script>
<script language="javascript">
var options = {}
options.processSid = 'a2acae5b-0934-4ff9-8259-ba9da5facb8a';
options.theme = 'mono-green';
options.container = 'integrifyWidget';
var processForm = IntegrifyEmbedder.embedStartProcessForm(options, function(err,response){
if (!err) {
//console.log(response);
alert('Your request has been submitted');
}
});
</script>
1
2
3
4
5
6
7
var processForm = IntegrifyEmbedder.embedStartProcessForm(options, function(err,response){
if (!err) {
//console.log(response);
location.href = "http://mysite.com/myconfirmationpage.html"
}
});
1
2
3
4
5
6
7
8
9
var processForm = IntegrifyEmbedder.embedStartProcessForm(options, function(err,response){
if (!err) {
//console.log(response);
if (response.next_tasks.length === 0) {
location.href = "http://mysite.com/myconfirmationpage.html"
}
}
});
1
2
3
4
5
6
7
8
9
10
11
...
options.guest = "MyInstanceID"; //this would match the name of your license file or the InstanceID provided to you by Integrify
var processForm = IntegrifyEmbedder.embedStartProcessForm(options, function(err,response){
if (!err) {
//console.log(response);
if (response.next_tasks.length === 0) {
location.href = "http://mysite.com/myconfirmationpage.html"
}
}
});
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var processForm = IntegrifyEmbedder.embedStartProcessForm(options, function(err,response){
if (!err) {
location.href="/myconfirmationpage.html";
}
});
IntegrifyEmbedder.control('integrifyWidget',{
selector:'formtaskpage',
event:'render',
handler: function(rtCmp) {
var container = rtCmp.up('task_runtimecontainer');
function setValues() {
//simple check if html is rendered, if not defer the recursive call
if (rtCmp.fields) {
//fill the fields by their Qustion ID (i.e.Q4425 - see the HTML Source in the Form Editor to verify)
rtCmp.fields.get("Q4425").value = '10000';
rtCmp.fields.get("Q4424").setValue('Yes'); //use .setValue for select lists
} else {
setTimeout(setValues, 500);
}
}
setValues();
}
});