Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

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:;%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>

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
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi,

The following links can be useful:

Link 1

.
Link 4.

Regards.


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(