Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>the problem is in the stopImageUpload() function. when you load the data and appending it to the placeholders you use the index of the current form the select the correct element to append to (like listImage)</p> <pre><code>if (success == 1){ result = '&lt;span class="imagemsg'+imagecounter+'"&gt;The file was uploaded successfully&lt;/span&gt;'; $('.hiddenimg').eq(window.lastUploadImageIndex).append('&lt;input type="text" name="imgid[]" id="'+imageID+'" value="' + imageID + '" /&gt;'); $('.listImage').eq(window.lastUploadImageIndex).append('&lt;div&gt;' + htmlEncode(imagefilename) + '&lt;button type="button" class="deletefileimage" data-imageID="'+imageID+'" data-image_file_name="' + imagefilename + '" value="'+imageID+'"&gt;Remove&lt;/button&gt;&lt;br/&gt;&lt;hr/&gt;&lt;/div&gt;'); } </code></pre> <p>but the hiddenimg element is only one so your selector doesn't find any dom element where to append the new . you code should be like this:</p> <pre><code>if (success == 1){ result = '&lt;span class="imagemsg'+imagecounter+'"&gt;The file was uploaded successfully&lt;/span&gt;'; $('.hiddenimg').append('&lt;input type="text" name="imgid[]" id="'+imageID+'" value="' + imageID + '" /&gt;'); $('.listImage').eq(window.lastUploadImageIndex).append('&lt;div&gt;' + htmlEncode(imagefilename) + '&lt;button type="button" class="deletefileimage" data-imageID="'+imageID+'" data-image_file_name="' + imagefilename + '" value="'+imageID+'"&gt;Remove&lt;/button&gt;&lt;br/&gt;&lt;hr/&gt;&lt;/div&gt;'); } </code></pre> <p>btw, form inside form is bad practice <a href="https://stackoverflow.com/questions/379610/can-you-nest-html-forms">Can you nest html forms?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload