Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

I want to know the item that I just added to the Form Repeater


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:;"%20data-repeater-delete=""%20class="btn%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:;"%20data-repeater-create=""%20class="btn%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:;"%20id="addRemainingDuration"%20class="btn%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:;"%20%20class="btn%20btn-sm%20font-weight-bolder%20btn-primary" target="_blank" rel="noopener noreferrer">
Save
</a>
</div>
</div>
</div>
</div>

here is Repeater JS:

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();
}
};
}();

So after clicking on addRemainingDuration button i have to add a remaining duration to kt_timepicker_1_validate, which i don't know how to get the added item.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

The following links can be useful:

Link 1

.
Link 4.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(