home     documentation     download     Spyce logo


<spy:parent title="Form tag example" />


<h2>Primitive controls</h2>

<div class="simpleform">
  <f:text name="mytext" label="Text" default="some text" size=10 maxlength=30 />

  <f:password name="mypass" label="Password" default="secret" />

  <f:textarea name="mytextarea" label="Textarea" default="rimon" rows=2 cols=50></f:textarea>

  <label for="mycheck">Checkbox</label><f:checkbox name=mycheck value=check1 />

  <label for="myradio1">Radio option 1</label><f:radio name=myradio value=option1 />
  <label for="myradio2">Radio option 2</label><f:radio name=myradio value=option2 />

<div style="clear: both">
  <h2 style="padding-top: 1em;">Compound controls</h2>
  [[-- a simple data source for the compound controls -- in practice
	     this would probably come from the database --]]
  [[ L = [('option %d' %i, str(i)) for i in range(5)] ]]

    <f:radiolist class=radio name=radiolist data="L" default="3" />

    <f:checkboxlist class=radio name=checkboxlist data="L" default="=['0', '1']" />

    <f:select name=myselect multiple size=5 data="L" default="2" />

    <f:date name=mydate />

  <h2 style="clear:both; padding-top: 1em;">Test it!</h2>
  <input type="submit" name="foo" value="Submit!">


Run this code

Back to List of Examples

Spyce logo
Python Server Pages
version 2.1.3
Spyce Powered SourceForge Logo