Is there a standard representation for HTML forms? Is there a standard representation for HTML forms? json json

Is there a standard representation for HTML forms?


The standard representation for HTML forms is... HTML forms.

As far as I know, no-one’s invented an alternative way to represent them because, well, why would you? They’re declarative already.

Thankfully, given that HTML can be written as XML (we call that XHTML), XHTML forms already satisfy your XML requirement.

As far as parsing them in JavaScript goes, it depends what you mean by parsing. John Resig is working on a full HTML parser in JavaScript, but if you’re just looking to read/write values via the DOM, you can do that in JavaScript.

The spec for HTML forms is here:

The spec for how to write HTML as XML is the XHTML 1.0 spec:

If you’d rather use HTML5 forms, which adds some new form fields (see http://diveintohtml5.ep.io/forms.html), the relevant specs are:


Templating Systems like mustache.js or ejs would help you convert your json to html.

http://mustache.github.com/

http://embeddedjs.com/index.html