Hello! I am trying to build simple order management platform where users can manually add order details to an order table via an order form modal. I need help with adding a new row each time the form has been submitted. Attached below are my screenshots (including query). The two issues i have are:
The order gets saved and returned once submitted but doesnt show up on the order table
The order form modal doesn't close when clicked on. I've tried modalName.close() in my query but I get an error saying the function doesn't exist.
It looks like you aren't actually saving the data to a DB, you're just putting it into an array of data.
Your table presumably pulls from a database table in the first place, so what you'll want to do is create a query that can add data to the table, then you'll want your script to trigger a refresh on the table / re-trigger the query that populates the table in the first place.
This page from the docs goes over the setup of a form to accomplish what you're looking for.