/
prefilled_form_example.html
74 lines (63 loc) · 2.48 KB
/
prefilled_form_example.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script type="module" src="../src/index.ts"></script>
</head>
<body>
<!--Place container div wherever you want to show the registration form-->
<div id="checkin_registration"></div>
<script>
const onDocumentReady = e => {
const checkinRegistrationForm = checkin_event.getEventRegistrationForm(49815);
/*
Pre-filling information might be useful
when you already have logged in user data
that you want to be populated on registration
form load.
*/
//Pre-fill ticket buyer information
checkinRegistrationForm.setOrderContact({
name: "Test testen",
phone: "+47 123 45 678",
countryCode: "NO",
email: "test@example.com"
});
/*
Connects a crm property to the participant that is linked to the order contact.
checkinRegistrationForm.setCrmProperty({
propertyKey: 'crm-property-key',
propertyValue: 123456,
context: orderContactParticipant
});
*/
/*
Add ticket by id.
*/
const earlyBirdTicket_orderContact = checkinRegistrationForm.addTicket(96492, true);
const earlyBirdTicket = checkinRegistrationForm.addTicket(96492);
/*
Set ticket participant crm data
*/
earlyBirdTicket.setParticipantInfo({
name: "Donald Duck",
phone: "+1 111",
countryCode: "US",
email: "donald@duck.com",
address: null
});
//Add additional by id
earlyBirdTicket.addAdditional(385827);
/*
Load registration form into container element. If container element does not exist,
you can provide an HTMLElement or element id to the init function to be the container
of the registration form.
*/
checkinRegistrationForm.initRegistrationForm();
}
document.addEventListener('DOMContentLoaded', onDocumentReady)
</script>
</body>
</html>