I have div boxes with addresses, each address has its own button, the button should open a dialog in which you can edit a specific address.
Button identifiers are always edit_address_ (number), and number is the database identifier. Thus, the numbers are not like 1,2,3, but can be 12, 35, 122, the dialog boxes for display have the identifier dialog-form_ (number).
So, how can you implement something, first get all the finite numbers of existing identifiers, and then make a loop for it
$( "#dialog-form_$i" ).dialog({ autoOpen: false, height: 300, width: 390, modal: true }); $('#edit_address_$i').button().click(function() { $('#dialog-form_$i').dialog('open'); });
I know that this code does not work correctly, but how to implement it?
source share