Name

form — web form with standard layout

Synopsis

LZX: form
JavaScript: form
Type: Class
Access: public
Topic: Components.Laszlo Components
Declared in: lps/components/lz/form.lzx

Description

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" src="http:../../examples/components/echo.jsp" />
              <window id="win" >
              <form>
              <submit name="survey" data="${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.

Extends the component grouping features of baseform to also provide standard layout for from controls. Buttons will be placed in a view at the bottom right of the form (placement 'buttonplace'). A form is typicaly a collection of UI elements where each represents data from the user that will be submitted to the server as a request.

Superclass Chain

node (LzNode) » view (LzView) » baseform » form

Known Subclasses

Known Direct Subclasses: validatingForm

Details

Properties (5)

inset_bottom
<attribute name="inset_bottom" value="10" />
public var inset_bottom;
The bottom inset for content appearing within form.
inset_left
<attribute name="inset_left" value="10" />
public var inset_left;
The left inset for content appearing within form.
inset_right
<attribute name="inset_right" value="10" />
public var inset_right;
The right inset for content appearing within form.
inset_top
<attribute name="inset_top" value="10" />
public var inset_top;
The top inset for content appearing within form.
spacing
<attribute name="spacing" value="10" />
public var spacing;
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).

LZX Synopsis

<class name="form" extends=" baseform ">
  <attribute name=" inset_bottom " value="10" />
  <attribute name=" inset_left " value="10" />
  <attribute name=" inset_right " value="10" />
  <attribute name=" inset_top " value="10" />
  <attribute name=" spacing " value="10" />
</class>

JavaScript Synopsis

public form extends  baseform  {
  public var inset_bottom ;
  public var inset_left ;
  public var inset_right ;
  public var inset_top ;
  public var spacing ;
}