Normally your category and author fields would be some control which displays the name and provides the ID value. There are several widgets which can aid you in this. For instance Vue Multiselect allows you to load your data from a JSON endpoint and do auto-completion. You'd just need one for category, and another for author.
Jun 11, 2018
1
Level 1
Storing Form Data in multiple tables having relation
I have a Form where user inputs bookTitle, edition, authorName, Book Category and total books available. So, I have three different tables books, authors and categories. The books table has two foreign keys author-id and category-id. I want to store book title, edition ,authorId and categoryId in books table , authorname and book category in category tables respectively. I confusion with storing the categoryId and authorId that how can I store it in books table as I an not recieving it from the form?
Please or to participate in this conversation.