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

[whatwg] input type=hidden outside phrasing content

From: Andy Lyttle <whatwg@phroggy.com>
Date: Thu, 16 Oct 2008 15:20:51 -0700
Message-ID: <8701DE87-CE71-41D6-AD16-3AA413660061@phroggy.com>
> That seems sort of weird though.  You're fine with putting the  
> <input type="text"> within the <td>, but you'd prefer *not* to do  
> the same with the <input type="hidden">?  It seems much more  
> reasonable to just put it in the exact same place.  At any rate, it  
> certainly doesn't seem like a compelling reason to change the  
> content model of <tr>.

Only because within the <td> I already had the value expressed as  
plain text.  I ended up with something like <td><input type="hidden"  
value="Foo">Foo</td> (except it was uglier).  I can't think of a  
specific example, but I know there's been something similar I wanted  
to do in the past that was similar that turned out uglier than this.

I'm not saying it's a compelling reason, just that wanting to do it  
isn't completely insane. :-)

-- 
Andy Lyttle
whatwg at phroggy.com



On Oct 16, 2008, at 3:07 PM, Tab Atkins Jr. wrote:

> On Thu, Oct 16, 2008 at 4:59 PM, Andy Lyttle <whatwg at phroggy.com>  
> wrote:
> <table>
>  <tr>
>    <input type="hidden" ...>
>    <td></td>
>  </tr>
> </table>
>
> This is something I wanted to do recently.  I was building HTML in  
> a Perl script, adding table rows in a loop, and I wanted some rows  
> to contain text field with user-editable value, while for other  
> rows I wanted the value to be displayed but not editable (and I  
> didn't want to use a disabled text input, I wanted the value  
> displayed as plain text and use a hidden input with the value  
> preset).  I believe I wound up putting the <input> inside the <td>,  
> which worked well enough but if putting it directly inside the <tr>  
> were valid I probably would have done that.
>
> That seems sort of weird though.  You're fine with putting the  
> <input type="text"> within the <td>, but you'd prefer *not* to do  
> the same with the <input type="hidden">?  It seems much more  
> reasonable to just put it in the exact same place.  At any rate, it  
> certainly doesn't seem like a compelling reason to change the  
> content model of <tr>.
>
> ~TJ
Received on Thursday, 16 October 2008 15:20:51 UTC

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