On Tue, Mar 15, 2016 at 09:23:44PM -0700, Aaron Wolf wrote:
> On 03/15/2016 09:20 PM, Bryan Richter wrote:
> > On Tue, Mar 15, 2016 at 09:13:49PM -0700, Aaron Wolf wrote:
> >>
> >> Are you saying that correct use of Yesod Forms will always generate
> >> the html <form> element?
> > 
> > I think I may be misunderstanding your question, but I would say the
> > precise opposite is true.
> > 
> > Yesod Forms do not generate <form> elements. If a developer is using a
> > Form, they must add the <form> element themselves.
> > 
> > Conversely, if a programmer is *defining* a custom, monadic Form, they
> > should *not* include a <form> element.
> > 
> 
> Okay, I think I understand that html can have what is effectively forms
> in that there are inputs and fields and no <form> is actually there in
> the markup. Is that okay? Or should forms always be in html <form> blocks?

In a valid HTML document, any form elements like <input> *must* be
nested within a <form>. We will never send HTML to the browser where
that isn't the case.

But, the Widget that a Form provides is not an HTML document. It is a
*snippet* of HTML.

In other words, the Widget that a Form provides can potentially be
misused. It can be misused because you *could* place it somewhere
*besides* within a <form>, and you would be creating malformed HTML.

However, there is never a reason to do that. One should always place a
Form's Widget underneath a <form>. The consequences will often be
obvious bugs.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Dev mailing list
[email protected]
https://lists.snowdrift.coop/mailman/listinfo/dev

Reply via email to