I have a modal which contain a form repeater, which contain a select dropdown and a text input displaying time, plus three buttons to add and save
and I want to know the current added item , to set the select dropdown with options, and add a specific time to the text input.
<div id="workSeparationDialog" class="modal-body">
<div id="kt_repeater_1">
<div class="form-group row" id="kt_repeater_1">
<div data-repeater-list="repeater-inner-list" class="col-lg-12">
<div data-repeater-item class="form-group row align-items-center">
<div class="col-md-4">
<label>Projects :</label>
<select id="projects_dropDown" class="custom-select" data-kt-repeater="select2" data-placeholder="Select a projects">
<option selected>Choose...</option>
</select>
</div>
<div class="col-md-5">
<label>Duration</label>
<div class="input-group timepicker">
<input class="form-control" id="kt_timepicker_1_validate" placeholder="Enter Duration"/>
<div class="input-group-append">
<span class="input-group-text"><i class="la la-clock-o"></i></span>
</div>
</div>
</div>
<div class="col-md-2 align-middle text-right mt-9">
<a href="javascript:;%22%20data-repeater-delete=%22%22%20class=%22btn%20btn-sm%20font-weight-bolder%20btn-light-danger" target="_blank" rel="noopener noreferrer">
<i class="la la-trash-o"></i>
</a>
</div>
</div>
</div>
</div>
<div class="form-group row">
<div class="col-lg-1 mr-10 h-100 text-left">
<a href="javascript:;%22%20data-repeater-create=%22%22%20class=%22btn%20btn-sm%20font-weight-bolder%20btn-light-primary" target="_blank" rel="noopener noreferrer">
Add
</a>
</div>
<div class="col-lg-5 h-100 ">
<a href="javascript:;%22%20id=%22addRemainingDuration%22%20class=%22btn%20btn-sm%20font-weight-bolder%20btn-light-primary" target="_blank" rel="noopener noreferrer">
Add Remaining duration
</a>
</div>
<div class="col-lg-4 h-100 text-right">
<a href="javascript:;%22%20%20class=%22btn%20btn-sm%20font-weight-bolder%20btn-primary" target="_blank" rel="noopener noreferrer">
Save
</a>
</div>
</div>
</div>
</div>
var KTFormRepeater = function() {
// Private functions
var demo1 = function() {
$("#kt_repeater_1").repeater({
initEmpty: false,
show: function() {
$(this).slideDown();
},
hide: function(deleteElement) {
$(this).slideUp(deleteElement);
}
});
}
return {
// public functions
init: function() {
demo1();
}
};
}();