-
Notifications
You must be signed in to change notification settings - Fork 4
/
index.html
315 lines (296 loc) · 17.9 KB
/
index.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Clone HTML/FORM</title>
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.9.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/select2/3.3.2/select2.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/css/bootstrap-select.css">
<style>
body{background-color:#F9F9FC;font-family: 'Roboto', sans-serif;font-size:14px;}
.select2-container {
padding: 0;
border: none;
}
h3{margin-bottom:0;}
.card{box-shadow: 0 0 13px 0 rgba(82,63,105,.05);background-color: #fff;margin-bottom: 20px;border-radius: 4px;padding: 20px;}
.select2-choice {
display: block;
width: 100%;
height: calc(1.5em + .75rem + 2px) !important;
padding: .375rem .75rem !important;
font-size: 1rem;
font-weight: 400;
line-height: 1.5 !important;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: .25rem;
transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
</style>
</head>
<body>
<div class="card">
<div class="container">
<h6><em>NOTE: If you are using any third party plugin then you must add following class to initiate.</em></h6>
<ol>
<li>Bootstrap Datepicker: add class into input "<span class="text-danger">datepicker-init</span>"</li>
<li>Ckeditor: add class into input "<span class="text-danger">ckeditor-init</span>"</li>
<li>Select2: add class into input "<span class="text-danger">select2-init</span>"</li>
<li>Chosen Dropdown: add class into input "<span class="text-danger">chosen-init</span>"</li>
</ol>
</div>
</div>
<div class="container">
<div class="margin-t-md">
<div class="customer-form">
<div class="card">
<h3>Dynamic Form</h3>
</div>
<form action="submit.php" method="post" role="form" autocomplete="off">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="customer-first_name">First name</label>
<input type="text" id="customer-first_name" class="form-control" name="Customer[first_name]"
maxlength="32" aria-required="true" placeholder="Rajneesh">
<p class="help-block help-block-error"></p>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="customer-last_name">Last name</label>
<input type="text" id="customer-last_name" class="form-control" name="Customer[last_name]"
maxlength="64" aria-required="true" placeholder="Gautam">
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="customer-email">Email</label>
<input type="text" id="customer-email" class="form-control" name="Customer[email]" maxlength="32" aria-required="true">
<p class="help-block help-block-error"></p>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="customer-dob">DOB</label>
<div class="input-group">
<input type="text" id="customer-dob" class="form-control datepicker" name="Customer[email]">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
</div>
<div id="main-container">
<div class="panel card container-item">
<div class="panel-body">
<div class="panel-body">
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="address_line_one_0">Address line 1</label>
<input type="text" id="address_line_one_0" class="form-control" name="Address[0][address_line1]" maxlength="255">
<p class="help-block help-block-error"></p>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="address_line_two_0">Address line 2</label>
<input type="text" id="address_line_two_0" class="form-control" name="Address[0][address_line2]" maxlength="255">
<p class="help-block help-block-error"></p>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="city_0">City</label>
<input type="text" id="city_0" class="form-control" name="Address[0][city]" maxlength="64">
<p class="help-block help-block-error"></p>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="state_0">State</label>
<select class="form-control select2 select2-init" name="Address[0][state]" id="state_0">
<option>Alabama</option>
<option>Alaska </option>
<option>Arizona </option>
<option>Arkansas </option>
<option>California </option>
<option>Colorado </option>
<option>Connecticut </option>
<option>Delaware </option>
<option>Florida </option>
<option>Georgia </option>
<option>Hawaii </option>
<option>Idaho </option>
<option>Illinois Indiana </option>
<option>Iowa </option>
<option>Kansas </option>
<option>Kentucky </option>
<option>Louisiana </option>
<option>Maine </option>
<option>Maryland </option>
<option>Massachusetts </option>
<option>Michigan </option>
<option>Minnesota </option>
<option>Mississippi </option>
<option>Missouri </option>
<option>Montana Nebraska </option>
<option>Nevada </option>
<option>New Hampshire </option>
<option>New Jersey </option>
<option>New Mexico </option>
<option>New York </option>
<option>North Carolina </option>
<option>North Dakota </option>
<option>Ohio </option>
<option>Oklahoma </option>
<option>Oregon </option>
<option>Pennsylvania Rhode Island </option>
<option>South Carolina </option>
<option>South Dakota </option>
<option>Tennessee </option>
<option>Texas </option>
<option>Utah </option>
<option>Vermont </option>
<option>Virginia </option>
<option>Washington </option>
<option>West Virginia </option>
<option>Wisconsin </option>
<option>Wyoming</option>
</select>
<!--<select id="state_0" class="form-control select2-init" name="Address[0][city]">
<option value="" data-select2-id="2">Select a state ...</option>
<optgroup label="Alaskan/Hawaiian Time Zone">
<option value="AK">Alaska</option>
<option value="HI">Hawaii</option>
</optgroup>
<optgroup label="Pacific Time Zone">
<option value="CA">California</option>
<option value="NV">Nevada</option>
<option value="OR">Oregon</option>
<option value="WA">Washington</option>
</optgroup>
</select>-->
</div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="customer-startdate_0">Start Date</label>
<div class="input-group">
<input type="text" id="customer-startdate_0" class="form-control datepicker-init" name="Address[0][startdate]">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="control-label" for="customer-enddate_0">End Date</label>
<div class="input-group">
<input type="text" id="customer-enddate_0" class="form-control datepicker-init" name="Address[0][enddate]">
<div class="input-group-prepend">
<span class="input-group-text" id="inputGroup-sizing-default"><i class="far fa-calendar-alt"></i></span>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group">
<textarea name="Address[0][desc]" id="desc_0" class="ckeditor-init" rows="10" cols="80"></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div>
<a href="javascript:void(0)" class="remove-item btn btn-sm btn-danger remove-social-media">Remove</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="card">
<div>
<a class="btn btn-success btn-sm" id="add-more" href="javascript:;" role="button"><i class="fa fa-plus"></i> Add more address</a>
<button type="submit" class="btn btn-primary btn-sm">Submit</button>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/3.3.2/select2.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.6.3/js/bootstrap-select.js"></script>
<script src="https://cdn.ckeditor.com/4.5.1/standard/ckeditor.js"></script>
<script src="cloneData.js" type="text/javascript"></script>
<script>
$('a#add-more').cloneData({
mainContainerId: 'main-container', // Main container Should be ID
cloneContainer: 'container-item', // Which you want to clone Should be Class Name
removeButtonClass: 'remove-item', // Remove button for remove cloned HTML
removeConfirm: true, // default true confirm before delete clone item
removeConfirmMessage: 'Are you sure want to delete?', // confirm delete message
//append: '<a href="javascript:void(0)" class="remove-item btn btn-sm btn-danger remove-social-media">Remove</a>', // Set extra HTML append to clone HTML
minLimit: 1, // Default 1 set minimum clone HTML required
maxLimit: 5, // Default unlimited or set maximum limit of clone HTML
defaultRender: 1,
init: function () {
console.info(':: Initialize Plugin ::');
},
beforeRender: function () {
console.info(':: Before rendered callback called');
},
afterRender: function () {
console.info(':: After rendered callback called');
//$(".selectpicker").selectpicker('refresh');
},
afterRemove: function () {
console.warn(':: After remove callback called');
},
beforeRemove: function () {
console.warn(':: Before remove callback called');
}
});
/*$('.select2').select2({
placeholder: 'Select a month'
});*/
$(document).ready(function () {
$('.datepicker').datepicker();
});
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
/*CKEDITOR.editorConfig = function (config) {
config.language = 'es';
config.uiColor = '#F7B42C';
config.height = 300;
config.toolbarCanCollapse = true;
};*/
//CKEDITOR.replace('editor1');
</script>
</body>
</html>