Using Forms to Specify the Data to Retrieve
3
4
Reviewing the code
The following table describes the highlighted code and its function:.
Code
<form action="actionpage.cfm"
<input type="Text" name="FirstName"
<input type="Text" name="LastName"
<input type="Text" name="Salary"
<!-- check box -->
<p>
Contractor? <input type="checkbox" name="Contractor" value="Yes"
checked>Yes
</p>
<!-- reset button -->
<input type="Reset" name="ResetForm" value="Clear Form">
<!-- submit button -->
<input type="Submit" name="SubmitForm" value="Submit">
</form>
</body>
</html>
Save the page as formpage.cfm within the myapps directory under your Web root
directory.
View the form in a browser.
The form appears in the browser.
Remember that you need an action page in order to submit values; you will create
one later in this chapter.
method="post">
size="20" maxlength="35">
size="20" maxlength="35">
size="10" maxlength="10">
Description
Gather the information from this form
using the Post method, and do something
with it on the page actionpage.cfm.
Create a text box called FirstName where
users can enter their first name. Make it
20 characters wide, but allow input of up
to 35 characters.
Create a text box called LastName where
users can enter their first name. Make it
20 characters wide, but allow input of up
to 35 characters.
Create a text box called Salary where
users can enter a salary to look for. Make
it 10 characters wide, and allow input of
up to 10 characters.
43
Need help?
Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?
Questions and answers