répéteur jQuery
$('.repeater').repeater({
defaultValues: {
'this_id': '1',
'this_name': 'foo'
}
});
Santino
$('.repeater').repeater({
defaultValues: {
'this_id': '1',
'this_name': 'foo'
}
});
view source
01
<div class="items" data-group="test">
02
<!-- Repeater Content -->
03
<div class="item-content">
04
<div class="form-group">
05
<label for="inputEmail" class="col-lg-2 control-label">Name</label>
06
<div class="col-lg-10">
07
<input type="text" class="form-control" id="inputName" placeholder="Name" data-name="name">
08
</div>
09
</div>
10
<div class="form-group">
11
<label for="inputEmail" class="col-lg-2 control-label">Email</label>
12
<div class="col-lg-10">
13
<input type="text" class="form-control" id="inputEmail" placeholder="Email" data-skip-name="true" data-name="email">
14
</div>
15
</div>
16
</div>
17
<!-- Repeater Remove Btn -->
18
<div class="pull-right repeater-remove-btn">
19
<button id="remove-btn" class="btn btn-danger" onclick="$(this).parents('.items').remove()">
20
Remove
21
</button>
22
</div>
23
</div>