Tectu / malloy

A cross-platform C++20 library providing embeddable server & client components for HTTP and WebSocket.
BSD 3-Clause "New" or "Revised" License
66 stars 8 forks source link

HTML form: check for requires fields #116

Open Tectu opened 2 years ago

Tectu commented 2 years ago

The malloy::html::form class should perform check regarding all fields marked as required when parsing via parse().

Tectu commented 2 years ago

Draft: f86a48d189767b3e57028830738d23b5de2834a0

Tectu commented 2 years ago

I'm not too happy with this initial draft.

I think it might be better to have a separate/dedicated function in html::form to perform this check. This separate function could return/provide more detailed information such as the list of fields which are missing values. A consumer could then use this information to notify the user appropriately about the missing required fields.