javascript - jQuery - Dynamic inputs are not appending into form submit -


i trying create button "add field" add file type inputs dynamically defined below:

$("#addnew").click(function(e) {     e.preventdefault();     $(".gallery-container").append('<div class="col-md-3"><div id="image-preview-'+id+'" class="image-preview"><label id="image-label-'+id+'" for="image-upload-'+id+'" class="image-label">wybierz plik</label><input type="file" id="image-upload-'+id+'" name="gallery[]" accept="image/*" class="image-upload" /></div><button type="button" class="removeimage btn btn-danger btn-sm btn-block">usuĊ„ plik</button></div>');         id++; }); 

it's adding input fields correctly , each input have file when tried submit form (no ajax, standard), these fields not submitted.

when set "append" hardcoded in code, i.e. next "add field" button, fine, problem when dynamically added.

where problem?


Comments

Popular posts from this blog

service - Android MediaPlayer calls onCompletion before it already finished -

javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -

javascript - Create a stacked percentage column -