W3C home > Mailing lists > Public > public-html@w3.org > May 2007

Re: WF2, attach hidden xml

From: Bruce Boughton <bruce@bruceboughton.me.uk>
Date: Thu, 31 May 2007 09:35:51 +0100
Message-ID: <465E88E7.8020404@bruceboughton.me.uk>
To: Dmitry Turin <html60@narod.ru>
CC: public-html@w3.org
Dmitry Turin wrote:
> I become sure definitively,
> that <input type="hidden" name="a" value="b"> is particular case of
>
> <hidden>
>   <field name="a">b</field>
> <hidden>
>   

While I can see your point, it would be folly to abolish <input 
type="hidden"> in favour of <hidden><field ..></hidden>.  There is 
nothing intrinsically wrong with <input type="hidden"> and it is well 
entrenched in HTML and used on millions of pages.  It would be like me 
suggesting we replace all occurrences of the word "sad" in English with 
"unhappy".  It is not a productive step.

For your proposal, there seem to be two options:

   1. Use a new element, say <hidden>, and keep <input type="hidden">
      simple name/value pairs
   2. Use a new element, say <hidden>, and deprecate <input type="hidden">
   3. Change the specification of <input> so that it is no longer an
      empty element when type="hidden"

Option (2) I think is out of the question.  Option (3) may not be 
attractive since <input> is currently defined in HTML4.1 as an empty 
element and I can see nothing in WF2 or HTML5 which states otherwise.  
It would possibly be unintuitive if it were non-empty only for 
type="hidden".  It seems likely, then, that option (1), a new form 
element would be appropriate for this.

Alternatively, you could have something like the following:

<html>
<head>
  <title>Forms submission with data</title>
  *<data name="mydata">Some JSON/XML data goes in here.</data>*
</head>
<body>
  <form>
    <input type="hidden" name="somedata" *source="mydata"* />
    <input type="submit" name="submit" value="Submit data" />
  </form>
</body>
</html>


The above uses the <label for=""> mechanism to reference the name of an 
element containing the data (possibly in the head to avoid it being 
displayed in legacy browsers--does this work?).

Bruce


Received on Thursday, 31 May 2007 08:36:00 UTC

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:38:44 UTC