W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2008

[whatwg] input type=hidden outside phrasing content

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 15 Oct 2008 20:29:11 -0500
Message-ID: <dd0fbad0810151829p468af6d1v333af709bb9f5ff9@mail.gmail.com>
On Wed, Oct 15, 2008 at 2:39 PM, Mike Wilson <mikewse at hotmail.com> wrote:

> Would it be possible to have HTML5 allow the insertion of
>  <input type="hidden" ...>
> (or something with the same effect) anywhere in the document?
> This would f ex relieve cases like server-side templating
> wanting to attach hidden state to its generated markup, and
> not having to use complex algorithms to find a suitable spot.
> As this type of element is non-visual this suggestion
> shouldn't cause any layout problems, but I guess having
> different placement rules for different settings on the same
> element type is, so maybe using <input> is not possible.
> Could HTML5 support adding hidden POSTable state in another
> way, that wouldn't be subject to placement rules for visual
> content?
> Best regards
> Mike Wilson

For arbitrary state accessible to in-page scripting (like javascript), html5
defines the data-* family of attributes on all elements.  These can have any
name (as long as it starts with "data-") and can hold arbitrary data.

For POSTable state, the state needs to be within the <form> that's being
submitted in any case, so being able to place the hidden state outside of
the form wouldn't get you much.  Can you elaborate on what you're proposing?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20081015/62910fc8/attachment.htm>
Received on Wednesday, 15 October 2008 18:29:11 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:06 UTC