Archive for the 'html5' Category

HTML5 and URI Templates

Saturday, December 15th, 2007

Although I am choosing to hold on to a general skepticism about HTML5, I am holding out some hope that it will lead to some good things. There are, for instance, many things to like about the revised and enhanced treatment of HTML forms. One additional change that I would like to see is support for URI Templates, for instance:

<form template="http://example.org{-prefix|/|foo}" method="POST">
  Foo: <input name="foo" type="input" >
  Bar: <input name="bar" type="input">
</form>

Here, the template attribute takes the place of the action attribute, and specifies a URI Template. The value of the foo variable in the template is taken from the foo input box. Since the bar variable is not used in the template, it is included in the body of the form post.

Here’s another example that should be obvious.

<form template="http://example.org{-prefix|/|foo}?bar={bar}" method="GET">
  Foo: <input name="foo" type="input" >
  Bar: <input name="bar" type="input">
</form>

I’m certain there are a number of subtle details that would need to be worked out, but for the most part I think this would be an invaluable addition.


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser