File: form.tml

package info (click to toggle)
tclws 2.6.2-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 884 kB
  • sloc: tcl: 7,431; makefile: 18
file content (46 lines) | stat: -rw-r--r-- 1,101 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[html::author "Brent Welch"]
[mypage::header "Templates and State"]
<b>Sample Form</b>
<p>
<form action=$page(url) method=POST>
<table>
[html::row "General Info" "<input type=text [html::formValue data]>"]
[html::row "Exclusive Choice" \
    [html::radioSet somevariable {&nbsp;} {
	orange Orange
	blue Blue
	green Green
	"violet red" "Violet Red"
    }]]
[html::row "Selection" \
    [html::select mutli 1 {
	"" "Please Select"
	orange Orange
	blue Blue
	green Green
	"violet red" "Violet Red"
    }]]
[html::row "Multiple Choice " \
    [html::checkSet check "&nbsp;" {
	orange Orange
	blue Blue
	green Green
	"violet red" "Violet Red"
    }]]
</table>
Hit this page with form data:
<input type=submit>

<p>
When a template is processed, information about the CGI values
is available via the <b>ncgi</b> module,
and the <b>html</b> module used to create the above form
automatically initializes the form elements to match the CGI values.
<p>
<b>CGI Values</b><br>
[html::tableFromList [ncgi::nvlist] "border=1"]
<p>
<b>Environment</b><br>
[html::tableFromArray ::env "border=1" *]

[mypage::footer]