Title: Using forms
1Using forms
- FORM attributes
- ACTION name of the script or program to be
executed - METHOD how data is sent to the web server
lthtmlgt ltheadgt lttitlegtForm Example
1lt/titlegt lt/headgt ltbodygt ltform action"partresult1
.cfm" method"post"gt Please enter the name of the
item class you wish information about and then
click ltbgtProcesslt/bgt. ltpgt Item class ltinput
type"text" name"itemclss"gt ltbrgt ltinput
type"submit" value"Process"gt lt/formgt lt/bodygt lt/h
tmlgt
Creates a text field
Unique name of the field
Label of the button
Creates a button, which, when clicked, submits
the form to the web server for processing
2Results template
lt CFQUERY DATASOURCE"oracle" Name"parts" gt selec
t partnumb, partdesc, unonhand,wrehsenm,unitprce
from part where itemclss'itemclss lt/cfquerygt lt
bodygt ltcfoutputgt ltH1gtParts in item class
itemclss lt/H1gt lt/cfoutputgt ltcftable
query"parts"gt ltcfcol header"ltbgtPart numberlt/bgt"
width15 text"ltigtpartnumblt/igt"gt ltcfcol
header"ltbgtPart namelt/bgt" width10
text"ltigtpartdesclt/igt"gt ltcfcol header"ltbgtunits
on handlt/bgt" width20 text"ltigtunonhandlt/igt"gt ltc
fcol header"ltbgtwarehouse numberlt/bgt" width20
text"ltigtwrehsenmlt/igt"gt ltcfcol header"ltbgtUnit
pricelt/bgt" width20 text"ltigtunitprcelt/igt"gt lt/cf
tablegt lt/bodygt lt/htmlgt
3Using forms example
4Assignment 8 due 4/29/99
- Write a CFML program that would take the
warehouse number as input from the user, and
display the following information of all parts
stored in that warehouse description, unit
price, - quoted price, as shown below