summaryrefslogtreecommitdiff
path: root/web/src/cgi.tcl-1.10/example/form-tour-result.cgi
blob: d1278ecff962504e73f69a1c327b4dec47036c4f (plain)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/depot/path/tclsh

# This is a CGI script that shows the result of the form tour.

package require cgi

cgi_eval {
    source example.tcl

    cgi_input
    cgi_title "Form Element Tour Results"

    cgi_body {
	h4 "This is a report of variables set by the form tour."

	if {0!=[catch {cgi_import Foo0}]} {
	    h5 "Error: It appears that you have invoked this script
	    without going through [cgi_url "the intended form" [cgi_cgi form-tour]]."
	    cgi_exit
	}

	catch {
	    cgi_import Map.x
	    cgi_import Map.y
	    puts "image button coordinates = ${Map.x},${Map.y}[nl]"
	}

	catch {
	    cgi_import Action
	    puts "submit button Action=$Action[nl]"
	    br
	}

	foreach x {version A B C D} {
	    catch {
		cgi_import $x
		puts "radio button \"$x\": [set $x][nl]"
	    }
	}
	catch {
	    cgi_import VegieList
	    puts "checkbox Vegielist = $VegieList[nl]"
	}
	for {set i 0} {$i<=6} {incr i} {
	    set var Foo$i
	    cgi_import $var
	    puts "text $var:"
	    cgi_preformatted {
		puts [set $var]
	    }
	}
	for {set i 0} {$i<=9} {incr i} {
	    set var Foo1$i
	    cgi_import $var
	    puts "textvar $var:"
	    cgi_preformatted {
		puts [set $var]
	    }
	}
	catch {
	    cgi_import Foo
	    puts "select pull-down Foo: $Foo[nl]"
	}
	catch {
	    cgi_import FooList
	    puts "select scrolled list FooList: $FooList[nl]"
	}
    }
}