<form>
web form with standard layout

JavaScript: lz.form
extends <baseform> » <view> » <node> » lz.Eventable »

The <form> tag allows you to create a web form and provides automatic layout. Most components are laid out vertically with buttons at the lower right. The data represented by components that are enclosed in the form tag can be sent to the server using the <submit> tag. Each form component, such as checkbox, combobox or radiogroup must have a name. The data is submitted as name-value pairs, using the name and value of the component.

<canvas height="200">
              <dataset name="echoer" type="http" src="/@WEBAPP@/examples/components/echo.jsp"/>
              <window id="win">
              <form>
              <submit name="survey" dataset="${echoer}"/>
              <statictext>What is your favorite vacation spot?</statictext>
              <radiogroup name="place">
              <radiobutton>Hawaii</radiobutton>
              <radiobutton>Paris</radiobutton>
              <radiobutton>Jamaica</radiobutton>
              </radiogroup>
              <button isdefault="true" onclick="parent.survey.submit()">submit</button>
              </form>
              </window>
              
              <view x="260" y="20" layout="class: simplelayout" datapath="echoer:/response">
              <text text="Data received"/>
              <view layout="axis: y">
              <view datapath="formcomponent" layout="axis:x">
              <text resize="true" datapath="@name"/>
              <text text=":"/>
              <text resize="true" datapath="text()"/>
              </view>
              </view>
              </view>
              </canvas>

If you want to include buttons in the form that are not placed in the lower-right, you can specify placement="content" in the button tag. To use a custom layout with a form, use the <baseform> tag.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
inset_bottom expression any 10 read/write
  The bottom inset for content appearing within form.
inset_left expression any 10 read/write
  The left inset for content appearing within form.
inset_right expression any 10 read/write
  The right inset for content appearing within form.
inset_top expression any 10 read/write
  The top inset for content appearing within form.
spacing expression any 10 read/write
  Vertical space between content and button area. If forms height is specified, the button area will be flush against the form's bottom right corner (adjusted by any layout that the form has).

Attributes inherited from <baseform>

changed, formdata

Methods

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <baseform>

onchanged

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy