Fill a form with a tabled record

Hi everyone,

I have a CBV view that handles the POST for a form and the GET for a table.

Both the form and table are visible on the HTML page.

The usual flow is:

User populates form with data - page refreshes showing record in the below table

What I’d like to add now, is the ability to select a record from the table and fill the above form with that record so that it can be “edited” and then resubmitted.

I will create a separate FBV for editing of the record.

I just wanted to confirm if this process was possible?

Thanks

Most definitely possible.

This can either be done with Django using a page refresh, or using JavaScript to initialize the form without a page refresh. (The latter requires that all the data needed for the form is available from the table.)