When you click on the button with the remove class, you need to get the id of the form in which this button is located. Here is the code with two forms (Two identical forms with different IDs (generated using PHP)):
And I have the following script
$(".remove").on("click", function(){ alert ($(this).parent().parent().attr("id")); });

$(document).ready(function(){ ... });- Sergeyalertnot shown, thealertis shown with the wrong text, the browser is closed, the computer is turned off. - Igor