Untitled-1.js
1.76 KB
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
<script type="text/javascript">
function floorplan_form(event) {
var name = jQuery('input[name="name"]').val();
var email = jQuery('input[name="email"]').val();
var mobile = jQuery('input[name="phonenumber"]').val();
var formname = jQuery('input[name="formname"]').val();
var utmsource = jQuery('input[name="utm_source"]').val();
var utmmedium = jQuery('input[name="utm_medium"]').val();
var utmcampaign = jQuery('input[name="utm_campaign"]').val();
var utmcontent = jQuery('input[name="utm_content"]').val();
$.ajax({
url: 'https://docs.google.com/forms/d/e/1FAIpQLSeDq16qoqjG3AFO_qnAKats8BPTtl7qLiwQFeM8SICj2NNxVA/formResponse',
type: 'POST',
data: {
"entry.1866747040=" . urlencode($name);
"&entry.391332552=" . urlencode($mobile);
"&entry.1319169842=" . urlencode($email);
"&entry.380527525=" . urlencode($formname);
"&entry.1619886954=" . urlencode($utmsource);
"&entry.1888285929=" . urlencode($utmmedium);
"&entry.731420388=" . urlencode($utmcampaign);
"&entry.1910662605=" . urlencode($utmcontent);
},
dataType: "xml",
statusCode: {
0: function (data) {
console.log(data);
console.log('CROS Error');
download();
location.href = "./thankyou.php";
return true;
},
200: function (data) {
download()
location.href = "./thankyou.php";
},
403: function (data) {
console.log('403 Error');
}
},
error: function (xhr, status, error) {
console.log('There was an error in CRM Entry');
}
})
return false;
}
</script>