Populate data in modal form from clicked row
Populate data in modal form from clicked row
I have a table that has 5 columns presented to the user. I want to enable the user to click on a row, followed by an "edit" button, and have a modal dialog appear that has a form which enables the user to edit not only the 5 values in the table, but other values that are stored in the database but not presented in the table.
Thus far, I have the ability to highlight the row clicked, get the item ID of the row, and show a blank form in the modal dialog. How can I go about populating the fields in the dialog?
One tricky part: some of the form fields in the dialog are dropdown boxes that pull their values from a separate table from the table in which the item itself is stored (ie, the item has a manufacturer, and in the item table, the manufacturer is an index into the manufacturer table, which lists the actual manufacturers).
It would be easiest if there were a way for the js to call a php file that could do the heavy lifting in the database.
Is there any way to accomplish this?
Thus far, I have the ability to highlight the row clicked, get the item ID of the row, and show a blank form in the modal dialog. How can I go about populating the fields in the dialog?
One tricky part: some of the form fields in the dialog are dropdown boxes that pull their values from a separate table from the table in which the item itself is stored (ie, the item has a manufacturer, and in the item table, the manufacturer is an index into the manufacturer table, which lists the actual manufacturers).
It would be easiest if there were a way for the js to call a php file that could do the heavy lifting in the database.
Is there any way to accomplish this?
This discussion has been closed.
Replies