Autodesk 15606-011408-9300 Developer Guide - Page 105

program in the form of a URL. The form in, calls yet another

Page 105 highlights

The next line creates a new browser window, using the loc variable to supply the URL. The last line shifts browser focus to the new window we just created. Now, let's look at the second CFM file, the showform.cfm file: Attribute Input Incident Report: Reported By: The showform.cfm file does indeed show a form, which is used to enter a description of the incident. The bulk of the file is a standard HTML form. The form has been placed within tags to give us access to the ColdFusion variables #LAT# and #LON#. Once again, these variables are replaced on the server by the userspecified lat/lon coordinates. In short, an HTML form collects data from the user and sends that data to a program in the form of a URL. The form in showform.cfm calls yet another CFM file, insert.cfm, passing it the following parameters: I The latitude value represented by the ColdFusion variable #LAT#; this value is passed as the form parameter rpt_lat. I The longitude value represented by the ColdFusion variable #LON#; this value is passed as the form parameter rpt_lon. I An incident description entered in the form by a user; this description is passed as the form parameter rpt_info. I A name entered in the form by a user; this name is passed as the form parameter rpt_by. Creating Report Scripts with ColdFusion | 105

  • 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
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208

Creating Report Scripts with ColdFusion
|
105
The next line creates a new browser window, using the
loc
variable to supply
the URL. The last line shifts browser focus to the new window we just created.
Now, let
s look at the second CFM file, the
showform.cfm
file:
<HTML>
<HEAD>
<TITLE>Attribute Input</TITLE>
</HEAD>
<BODY BGCOLOR="SILVER">
<CFOUTPUT>
<FORM Name=myForm METHOD="POST" ACTION="insert.cfm">
<INPUT TYPE="hidden" NAME="rpt_lat" VALUE="#LAT#">
<INPUT TYPE="hidden" NAME="rpt_lon" VALUE="#LON#">
Incident Report:<BR>
<INPUT TYPE="text" MAXLENGTH="30" NAME="rpt_info" SIZE="33"><BR>
<BR>
Reported By:<BR>
<INPUT TYPE="text" MAXLENGTH="30" NAME="rpt_by" SIZE="33"><BR>
<BR>
<CENTER>
<INPUT TYPE="submit" NAME="Submit" VALUE="OK">
<INPUT TYPE="button" NAME="CancelButton" VALUE="Cancel"
onClick="window.close()">
</CENTER>
</FORM>
</CFOUTPUT>
</BODY>
</HTML>
The
showform.cfm
file does indeed show a form, which is used to enter a
description of the incident.
The bulk of the file is a standard HTML form. The form has been placed
within
<CFOUTPUT>
tags to give us access to the ColdFusion variables
#LAT#
and
#LON#
. Once again, these variables are replaced on the server by the user-
specified lat/lon coordinates.
In short, an HTML form collects data from the user and sends that data to a
program in the form of a URL. The form in
showform.cfm
calls yet another
CFM file,
insert.cfm
, passing it the following parameters:
The latitude value represented by the ColdFusion variable
#LAT#
; this
value is passed as the form parameter
rpt_lat
.
The longitude value represented by the ColdFusion variable
#LON#
; this
value is passed as the form parameter
rpt_lon
.
An incident description entered in the form by a user; this description is
passed as the form parameter
rpt_info
.
A name entered in the form by a user; this name is passed as the form
parameter
rpt_by
.