| 1 | # Simplified Forms Module |
| 2 | |
| 3 | form = |
| 4 | element form { |
| 5 | form.attlist, |
| 6 | # Don't use Block.model, because this gets redefined by the |
| 7 | # legacy module. |
| 8 | Block.class+ |
| 9 | } |
| 10 | form.attlist = |
| 11 | Common.attrib, |
| 12 | attribute action { URI.datatype }, |
| 13 | attribute method { "get" | "post" }?, |
| 14 | attribute enctype { ContentType.datatype }? |
| 15 | label = element label { label.attlist, Inline.model } |
| 16 | label.attlist = |
| 17 | Common.attrib, |
| 18 | attribute for { IDREF.datatype }?, |
| 19 | attribute accesskey { Character.datatype }? |
| 20 | input = element input { input.attlist } |
| 21 | input.attlist = |
| 22 | Common.attrib, |
| 23 | attribute type { InputType.class }?, |
| 24 | attribute name { text }?, |
| 25 | attribute value { text }?, |
| 26 | attribute checked { "checked" }?, |
| 27 | attribute size { text }?, |
| 28 | attribute maxlength { Number.datatype }?, |
| 29 | attribute src { URI.datatype }?, |
| 30 | attribute accesskey { Character.datatype }? |
| 31 | InputType.class = |
| 32 | "text" |
| 33 | | "password" |
| 34 | | "checkbox" |
| 35 | | "radio" |
| 36 | | "submit" |
| 37 | | "reset" |
| 38 | | "hidden" |
| 39 | select = element select { select.attlist, option+ } |
| 40 | select.attlist = |
| 41 | Common.attrib, |
| 42 | attribute name { text }?, |
| 43 | attribute size { Number.datatype }?, |
| 44 | attribute multiple { "multiple" }? |
| 45 | option = |
| 46 | element option { |
| 47 | Common.attrib, |
| 48 | attribute selected { "selected" }?, |
| 49 | attribute value { text }?, |
| 50 | text |
| 51 | } |
| 52 | textarea = element textarea { textarea.attlist } |
| 53 | textarea.attlist = |
| 54 | Common.attrib, |
| 55 | attribute name { text }?, |
| 56 | attribute rows { Number.datatype }, |
| 57 | attribute cols { Number.datatype }, |
| 58 | attribute accesskey { Character.datatype }?, |
| 59 | text |
| 60 | Form.class = form |
| 61 | Formctrl.class = input | label | select | textarea |
| 62 | Block.class |= Form.class |
| 63 | Inline.class |= Formctrl.class |