Re: HTML forms, XForms, Web Forms - which and how much?

On Mon, 30 Apr 2007 04:55:53 +0200, Matthew Raymond  
<mattraymond@earthlink.net> wrote:

> WF2:
> | <label>First name: <input name="firstname"></label>
> | <label>Surname: <input name="surname"></label>
> |
> | <output onforminput=
> | "value='Hello, ' + firstname.value + ' ' + surname.value" />
>
>    It's not quite a simple as your above example, but it's pretty close.

For someone who doesn't know about WF2, but knows HTML4 and JS, it's very  
straightforward to understand what it does.

<output>: Hmm, the opposite fo <input>? Probably.
onforminput="": Hmm, looks like an event handler attribute like onclick,  
but that listens to "forminput" events, presumably fired when the user  
inputs something to the form. I know how event handler attributes work, so  
what's inside works exactly like other event handler attributes.

Compare with this HTML4:

    <label>First name: <input name="firstname"></label>
    <label>Surname: <input name="surname"></label>

    <input onclick=
    "value='Hello, ' + firstname.value + ' ' + surname.value">

Not that it does the same thing, but my point is that an author who knows  
HTML4 can understand how the WF2 markup works without even reading the  
spec. I think this is important, since most authors won't read the spec.

> XForms Transitional:
> | <label>First name: <input name="firstname"></label>
> | <label>Surname: <input name="surname"></label>
> |
> | <input readonly calculate="'Hello, ' + firstname + ' ' + surname">
>
>    See that XForms Transitional is even simpler. When we hybridize the
> two, we get something that's conceptually identical to your example:
>
> WF2/XFT hybrid:
> | <label>First name: <input name="firstname"></label>
> | <label>Surname: <input name="surname"></label>
> |
> | <output calculate="'Hello, ' + firstname + ' ' + surname" />

These are, I think, a lot harder to understand for someone who only knows  
about HTML4+JS.

calculate="": Hmm... what's put inside looks like it could be JS, but the  
attribute doesn't look like an event handler attribute. Is it? Which  
events does it listen to? When do they fire? Can any JS be inserted here?  
Is it JS to begin with?

There's nothing in HTML4 that is similar to this.

Even I, who have read the XFT document, can't tell how calculate="" really  
works or what can be put inside. How should we expect authors who won't  
read the spec to understand it?

Shorter markup does not imply greater understanding among authors. I think  
it is a mistake to introduce non-event-handler-but-still-JS-attributes to  
HTML.

-- 
Simon Pieters

Received on Monday, 30 April 2007 09:33:37 UTC