-
Notifications
You must be signed in to change notification settings - Fork 15
/
sample-v1.html
124 lines (116 loc) · 3.78 KB
/
sample-v1.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<!DOCTYPE html>
<html>
<head>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Spreedly Express Demo Page</title>
<script type="text/javascript">
var formOnsubmit = function() {
var name = document.getElementById('sample-form-name').value;
if (name !== ''){
document.getElementById('express-script').setAttribute('data-full-name', name);
document.getElementById('express-script').setAttribute('data-amount', "$24.24");
continueToExpress = true;
}
var fieldsToAddToExpress = ["address1","city","state","zip",]
for ( var i = 0 ; i < fieldsToAddToExpress.length ; i ++){
document.getElementById('express-script').setAttribute('data-' + fieldsToAddToExpress[i], document.getElementsByName(fieldsToAddToExpress[i])[0].value);
}
}
</script>
<style>
#content{
width:500px;
margin:0 auto;
}
</style>
</head>
<body>
<div class="container" id="content">
<h1> Food and Stuff </h1>
<h2> Invoice</h2>
<table class="table table-bordered table-striped table-hover table-condensed">
<tr>
<th>Item Number</th>
<th>Description</th>
<th>Quantity</th>
<th>Price</th>
<th>Total</th>
</tr>
<tr>
<td>F-01</td>
<td>Ground Beef</td>
<td>2</td>
<td>10.12</td>
<td>10.12</td>
</tr>
<tr>
<td>S-03</td>
<td>Crow</td>
<td>2</td>
<td>2.00</td>
<td>4.00</td>
</tr>
<tr>
<td>Total</td>
<td></td>
<td>4 items</td>
<td></td>
<td>24.24</td>
</tr>
</table>
<br/>
<div class="form-group">
<form class="form-horizontal" role="form" action="/sampleresult.html" method="GET" id="express-form" onsubmit="formOnsubmit()" >
<div class="form-group">
<label class="control-label col-sm-1" for="sample-form-name">Name</label>
<div class="col-sm-8">
<input class="form-control" type="text"id="sample-form-name" name="full_name" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="sample-form-street-address">Street</label>
<div class="col-sm-8">
<input class="form-control" type="text"id="sample-form-street-address" name="address1" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="sample-form-city-address">City</label>
<div class="col-sm-8">
<input class="form-control" type="text"id="sample-form-city-address" name="city" required>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-1" for="sample-form-state-address">State</label>
<div class="col-sm-2">
<input class="form-control" type="text"id="sample-form-state-address" name="state"required>
</div>
<label class="control-label col-sm-1" for="sample-form-zip-address">Zip</label>
<div class="col-sm-3">
<input class="form-control" type="text"id="sample-form-zip-address" name="zip">
</div>
</div>
<div class="col-sm-offset-2 col-sm-4">
<button id="express-submit" type="submit" class="btn btn-primary btn-block" disabled="true">Continue</button>
</div>
<script
src="https://core.spreedly.com/iframe/express-1.min.js" id="express-script"
data-environment-key="TbWAYgG7qaagGBh7hPjXQxS4DM4"
data-amount=""
data-company-name="Food 'n Stuff"
data-sidebar-top-description="This is where you can buy all your food and most of your stuff"
data-sidebar-bottom-description="2 ground beef </br> 2 crows"
'data-full-name'=""
'data-address1'=""
'data-city'=""
'data-state'=""
'data-zip'=""
>
</script>
</form>
</div>
</div>
</body>
</html>