forked from jbillimoria/JavaScriptButtons
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathform.html
More file actions
43 lines (31 loc) · 1.08 KB
/
form.html
File metadata and controls
43 lines (31 loc) · 1.08 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
<form method="post" action="<%= url %>" target="_top">
<% var optionIdx = 0; %>
<% for (var key in data) { %>
<%
var item = data[key];
var renderable = (item.editable || item.value instanceof Array);
%>
<% if (renderable) { %>
<p class="paypal-group">
<label class="paypal-label">
<%= item.label || content[key] || key %>
<% if (item.value instanceof Array) { %>
<select class="paypal-select" name="os<%= optionIdx %>">
<% for (var i = 0, len = item.value.length; i < len; i++) { %>
<% var option = item.value[i].split(':') %>
<option value="<%= option[0] %>"><%= option.join(' ') %></option>
<% } %>
</select>
<input type="hidden" name="on<%= optionIdx %>" value="<%= item.label %>">
<% ++optionIdx; %>
<% } else { %>
<input type="text" id="<%= key %>" name="<%= key %>" value="<%= item.value %>" class="paypal-input" />
<% } %>
</label>
</p>
<% } else { %>
<input type="hidden" name="<%= key %>" value="<%= item.value %>" />
<% } %>
<% } %>
<%- button %>
</form>