Button.formbutton

A <button class="formbutton" is the most complicated element. It has a method submit() to which you can pass an arbitrary xul element; the button will recurse down the element and harvest all the queries from input elements, generate a query, send a form. The submit() method always returns a XMLHttpRequest in action. For more information, see http://www.xulplanet.com/references/objref/XMLHttpRequest.html

You may define event handlers like <button onresult="bla" and <button onerror="bla". These event handlers receive the request object.

If sync is true (<button class="formbutton" sync="true"), the default, the request is send in "sync". You can't do anything (but wait) until the result is received. There can only be one active synced request on a button; the synced request is set as a property on the button. Some properties of the synced request are also set as attributes on the button so you can observe them. You can use button.abort() to abort a synced request.

Example:

<button class="formbutton" label="submit" name="buttonclicked" value="3" action="test.cgi" oncommand="this.submit(document.getElementById('theform'))" onresult="alert('done')"/> result:
performs http query "test.cgi?bla=bla&bla=bla&buttonclicked=3", alerts 'done'

Additional Attributes:


Additional Properties:


Additional Methods: