Tuesday, 10 March 2020

Re: forms -- the "required" attribute

On Tue, Mar 10, 2020 at 04:23:30PM +0000, Jim Nagel wrote:
> I'm setting up an HTML <form> and tried to use the "required" attribute on
> one input field. (Actually my form consists of only that single field.)
>
> Unfortunately "required" has no effect in Netsurf (#5033 on Ro 5.25). The
> user can get away with just clicking Submit without entering any data.
>
> In the Netsurf documentation, the section on web standards says "Forms:
> nearly done". I presume this attribute is one of the undone-yet!

Indeed, however: given that you absolutely must check that the required
field has been provided at the server end, this only serves to prevent a
round trip and server-side error message rendering. This is important
because, well, not all HTTP clients will enforce the required attribute,
and people could inject bad data by just using wget or curl.

In short, you should be checking at the server anyway.

B.

No comments:

Post a Comment