How to pass html table data from template and store its content in an array in controller

23 views
Skip to first unread message

Ragini Prasad

unread,
Oct 18, 2016, 1:52:31 PM10/18/16
to Mojolicious
I have an html table and i need to pass the table data to controller when I submit the page. In controller i need to store this table data in an array. I am not finding how to do this anywhere.
Can somebody help.

Joel Berger

unread,
Oct 19, 2016, 9:27:19 AM10/19/16
to Mojolicious
In order to submit an array of table-like data (sometimes called rectangular data) you are probably best served by encoding the data as a JSON array and submitting that to the server.

You might consider using a front-end framework like Vue.js to drive the render in the client. That way, the client always has the data as an array. Then, once you have made some change, simply JSON encode the data and submit it to your site. Then again, I don't know what your goal is and it is possible that that is far overkill.
Reply all
Reply to author
Forward
0 new messages