I am relatively new in django and in this forum. In a project of mine using in django 5.1, I have designed a form where I am populating three dropdown list boxes (two of them are dependent or chained list boxes) with options coming from DB using HTMX.
After selecting desired options from the list boxes, the html table in this form (just below the list boxes) is being populated with the filtered data from DB based on three selection criteria (also done by HTMX). I have three columns (ID, Name and Check box) in this table and a Submit button at the end of the table. Everything is showing up (including filtered data along with a check box at the end of every row of the table) as expected.
I want to select items in the html table by clicking the check boxes and after hitting submit button, the IDs of selected items should be sent to a view method.
Clicking the submit button invoke the view method; but the problem is, the list containing IDs of selected items is empty. In the view, I am taking the list of selected items using following statement,
selected_ids = request.POST.getlist(‘item_id’)
Since the table-data are dynamically loaded, I am not seeing the source code for the html table rows containing my filtered data.
After searching the net, implementing (and re-implementing) the suggestions that I found on the net, didn’t solve my problem.
Question is how do I do this in django?
I will appreciate your response on my problem. Thanks in advance.