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