Personal tools


SimpleForms cheatsheet

From OrganicDesign

Jump to: navigation, search
Input type XHTML source Parser function Output
Text
First name: 
<input type="text" name="fname" value="Mickey" />
<br />
Last name: 
<input type="text" name="lname" value="Mouse" />
First name:
{{#input: type = text
    | name  = fname
    | value = Mickey
}}

Last name:
{{#input: type = text
    | name  = name
    | value = Mouse
}}
First name:

Last name:

Checkbox
<input type="checkbox" name="vehicle" value="Bike" checked="checked" />
I have a bike
<br />
<input type="checkbox" name="vehicle" value="Car" />
I have a car
<br />
<input type="checkbox" name="vehicle" value="Airplane" />
I have an airplane
{{#input: type = checkbox
    | name  = vehicle
    | value = Bike
    | checked = checked
}} I have a bike

{{#input: type = checkbox
    | name  = vehicle
    | value = Car
}} I have a car

{{#input: type = checkbox
    | name  = vehicle
    | value = Airplane
}} I have an airplane
I have a bike

I have a car

I have an airplane

Radio
Male: 
<input type="radio" checked="checked"
name="Sex" value="male">
<br>
Female: 
<input type="radio"
name="Sex" value="female">
{{#input: type=radio
| checked=checked
| name=Sex
| value=male}} Male 
{{#input: type=radio
|name=Sex
|value=female}} Female
Male

Female

Select
<select name="cars">
<option>Volvo</option>
<option>Saab</option>
<option>Fiat</option>
<option>Audi</option>
</select>
{{#input: type = select
| name = cars |
*Volvo
*Saab
*Fiat
*Audi
}}

Multiple select
<select name="cars" multiple>
<option>Volvo</option>
<option>Saab</option>
<option>Fiat</option>
<option>Audi</option>
</select>
{{#input: type = select
| name = cars
| multiple = 1 |
*Volvo
*Saab
*Fiat
*Audi
}}


Textarea
<textarea rows="10" cols="30">
The cat was playing in the garden.
</textarea>
{{#input: type = textarea
| rows = 10
| cols = 30
| The cat was playing in the garden.
}}
Button
<input type="button" value="Hello world!">
{{#input: type=button
| value=Hello world!}} 

See also