Usage

You don't have to 'install' anything as you can see in the testsuites; all formwidgets should work as they are here, online. To use them yourself you just add the CSS and XBL to your XUL. Generally, you The whole thing has a mozilla license, free to use and distribute, under conditions mentioned in that license.

Sending Forms

To take a set of formwidgets and send their contents through HTTP, you use a formbutton. A formbutton is itself not a formwidget, but it utilizes formwidgets for HTTP Requests. To get one, you In order to send the data, you pass a XUL element to the submit method of the formbutton. The element should contain all the formwidgets you want submitted. For example: <box> <textbox name="test" value="OK" class="formwidget" /> <button class="formbutton" oncommand="this.submit(this.parentNode)" action="test.cgi" onresult="alert(this.responseText)"/> </box> A click on the button will now traverse the parentnode (the box), find only the textbox formwidget, do a http query for test.cgi?test=OK and alert the response from the server. In this example, the button uses a synchronized GET request, the default.

Note that it is the button that sends the data. This is different from HTML, where the 'container element' (a form) appears to send its own content. In this project, there is no FORM element. Letting the button send the data makes more sense and has some practical advantages. In short, the data to process is separated from the logic of processing it.

Also note, the elements have more then the usual attributes and methods. For example, the textbox of class 'formwidget' has a new attribute "name". These are the extensions defined in XBL. The details for each element are explained in the chapter of each element.