useful links

Xforms code snippets

this is a test page for xforms snippets. I have been looking into xforms and have found that simple working examples are a bit thin on the ground. So as I learn a bit about it I am going to put samples here.

This page works really nicely in firefox, unfortunaly not all of the samples do. xsmiles is my current referance browser for the forms themselves.

If you have any advice or find these useful then please let me know (link in footer)

Simple select from inline data souce

This was the first thing I implemented with xforms, on the way to the multi select example

This area should contain the test form your browser dosn't like it This area should contain the test form source your browser dosn't like it Link to select test

Two levels of select

this is the end result of the first common issue that I tried to address with xforms, having a second level select box with values depending on what is in the first

This area should contain the test form your browser dosn't like it This area should contain the test form source your browser dosn't like it Link to select two levels test

Simple select from external data souce

Once I had the above samples working I thought I would see if I could call in data from an external data source

This is really easiliy done, in the example below I have called in the site menu and created a select box with all of the items in the menu

This area should contain the test form your browser dosn't like it This area should contain the test form source your browser dosn't like it Link to external select example

Simple binding

Binding makes xforms simple it helps you cleanly seperate the model from the form

The example below is the same as the one above but with bound elements instead of inline refs

This area should contain the test form your browser dosn't like it This area should contain the test form source your browser dosn't like it link to binding example

More binding

Not only can you use binding to bind form elements to instance data you can also bind constraints to the instance data

In the example below there are 3 text boxes they will contain invalid data (which should be styled differently) if they don't contain numbers and appear in decending order

This area should contain the test form your browser dosn't like it This area should contain the test form source your browser dosn't like it Link to second binding example

binding types

Xsmiles at lest (and possibly other implementations) will give different widgets for input elements that are bound with certian types

This area should contain the test form your browser dosn't like it This area should contain the test form source your browser dosn't like it Link to select test