wiki:TracFormsPlugin/Starter

Version 4 (modified by Steffen Hoffmann, 13 years ago) (diff)

add hint on more tutorial content

Another TracFormsPlugin Tutorial

Begin

This is the bare minimum (wiki) markup required to produce a form with TracForms syntax:

{{{
#!TracForm
[tf:mycheck] checked
}}}

Hereby you define a form with

  • default settings, i.e. no field change tracking, standard submit button label
  • one field
    • of default field type checkbox
    • with a label 'checked'

rendered result:

basic form example

Diversify

When you go on designing your forms, you may wish to arrange and more-or-less beautify them.

This is fairly easy using TracWiki markup. The following examples show only a small subset of the possibilities, but simple and advanced tables are certainly among the dominating design elements. Use common sense when deciding on parameters like table border width or background color.

More form fields

Most probably you'll want to have multiple form fields.

The single most important rule is: Make sure, that you have unique field names within a form.

{{{
#!TracForm
choose combinations
|| ||a||b||c||
||1||[tf:check1a]||[tf:check1b]||[tf:check1c]||
||2||[tf:check2a]||[tf:check2b]||[tf:check2c]||
||3||[tf:check3a]||[tf:check3b]||[tf:check3c]||
}}}

rendered result:

multiple fields example

How well does it scale? It has been proven to work for fairly large quantities of form fields.

I do use tickets with more than 120 checkboxes in one TracForm. --hasienda

Other field types

{{{
#!TracForm
[tf:mycheck] checked

[tf.input:myinput]

Like it? [tf.radio:mychoice true] Yes [tf.radio:mychoice false] No

[tf.select:myselect val0//(default) val1//label1 val2//label2]

Tell me more:[[BR]]
[tf.textarea:comment '(default comment)' 20 5]
}}}

rendered result:

field type showcase

Manage

Track changes

Submit button label

Form-related operations

{{{
#!TracForm
form ID: [tf.form_id:]

ToDo:[[BR]]
[tf.textarea:comment '(default comment)' 20 5][[BR]]
last comment:
by [tf.form_updater:]
on [tf.form_updated_on:]
}}}

rendered result:

form-specific data displayed


Read more in the expert section

Attachments (4)

Download all attachments as: .zip