Next.js Discord

Discord Forum

How strictly should I make everything a form?

Unanswered
Aerial yellowjacket posted this in #help-forum
Open in Discord
Aerial yellowjacketOP
A user has an inventory and is able to list those items for sale. I display their items in a card grid with their details and thumbnails. At the moment the submission is done without using a form, but I'm wondering if I'm doing more harm than good if I were to instead wrap the items in a select which is in a form and handle that accordingly.
for example:
// Current structure
<div className="grid ...">
  {items.map((i) => <Item key={i.id} .../>)}
</div>
// Proposed structure
<form className="grid" action={...}>
  <select name="items">
    {items.map((i) => <option key={i.id}><Item .../></option>)}
  </select>
</form>

1 Reply

Aerial yellowjacketOP
correction, it wouldn't be a select but a checkbox radio group