<form>

web form with standard layout

JavaScript: form

Extends Baseform

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.

See Also:
Attributes
Name Usage Type (Tag) Type (JS) Default Category
inset_bottom Tag & JS expression any 10 setter
 

The bottom inset for content appearing within form.


inset_left Tag & JS expression any 10 setter
 

The left inset for content appearing within form.


inset_right Tag & JS expression any 10 setter
 

The right inset for content appearing within form.


inset_top Tag & JS expression any 10 setter
 

The top inset for content appearing within form.


spacing Tag & JS expression any 10 setter
 

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, onchanged

Attributes inherited from Node

class, classroot, cloneManager, datapath, id, ignoreAttribute, ignoreplacement, immediateparent, initstage, name, nodeLevel, onconstruct, oninit, parent, placement, subnodes

Attributes inherited from View

aaactive, aadescription, aaname, aasilent, aatabindex, align, bgcolor, clickable, clickregion, clip, cursor, defaultplacement, fgcolor, focusable, focustrap, font, fontsize, fontstyle, frame, framesloadratio, hassetheight, hassetwidth, height, layout, loadratio, mask, onblur, onclick, ondata, ondblclick, onfocus, onkeydown, onkeyup, onmousedown, onmouseout, onmouseover, onmouseup, onselect, opacity, options, pixellock, play, resource, resourceheight, resourcewidth, rotation, selectiontype, showhandcursor, source, stretches, subviews, totalframes, unstretchedheight, unstretchedwidth, valign, visible, width, x, xoffset, y, yoffset


Methods

Methods inherited from baseform

addFormItem, commit, rollback, setChanged

Methods inherited from LzNode

animate, applyConstraint, applyData, childOf, completeInstantiation, createChildren, dataBindAttribute, destroy, determinePlacement, getAttribute, getOption, getUID, lookupSourceLocator, searchImmediateSubnodes, searchSubnodes, setAttribute, setDatapath, setID, setName, setOption

Methods inherited from LzView

addProxyPolicy, addSubview, bringToFront, construct, containsPt, getAttributeRelative, getBounds, getColor, getColorTransform, getContextMenu, getCurrentTime, getDepthList, getHeight, getID3, getMouse, getPan, getTotalTime, getVolume, getWidth, init, measureHeight, measureWidth, play, releaseLayouts, removeProxyPolicy, searchParents, searchSubviews, seek, sendBehind, sendInFrontOf, sendToBack, setAAActive, setAADescription, setAAName, setAASilent, setAATabIndex, setAlign, setAttributeRelative, setBGColor, setClickable, setColor, setColorTransform, setContextMenu, setCursor, setHeight, setLayout, setOpacity, setPan, setPlay, setResource, setResourceNumber, setRotation, setShowHandCursor, setSource, setValign, setVisible, setVolume, setWidth, setX, setY, shouldYieldFocus, stop, stretchResource, unload, updateResourceSize


Events

Events inherited from LzNode

onconstruct, ondata, oninit

Events inherited from LzView

onaddsubresource, onaddsubview, onblur, onclick, ondblclick, onerror, onfocus, onframe, onheight, onlastframe, onload, onmousedown, onmousedragin, onmousedragout, onmouseout, onmouseover, onmouseup, onmouseupoutside, onopacity, onplay, onremovesubview, onstop, ontimeout, onwidth, onx, ony