Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 871

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
<html>
<head>
</head>
<body>
<cfform name="mycfform">
First Name: <cfinput type="text" name="firstname" value=""><br>
Last Name: <cfinput type="text" name="lastname" value=""><br>
Domain: <cfinput type="text" name="domain" value=""><br>
E-mail: <cfinput type="text" name="email1" size="30"
bind="{firstname}.{lastname}@{domain}">
</cfform>
</body>
</html>
The following example shows the results of binding to radio buttons and check boxes with the same
different
attributes. Notice that because each control has a separate
id
the labels to select and deselect the controls.
<html>
<head>
</head>
<body>
<cfform name="myform">
Pick one:
<cfinput id="pickers1" name="pickone" type="radio" value="Apples">
<label for="pickers1">Apples</label>
<cfinput id="pickers2" name="pickone" type="radio" value="Oranges">
<label for="pickers2">Oranges</label>
<cfinput id="pickers3" name="pickone" type="radio" value="Mangoes">
<label for="pickers3">Mangoes</label>
<br>
<cfinput name="pickone-selected" bind="{pickone}"><br />
<br />
Pick as many as you like:
<cfinput id="pickers4" name="pickmany" type="checkbox" value="Apples">
<label for="pickers4">Apples</label>
<cfinput id="pickers5" name="pickmany" type="checkbox" value="Oranges">
<label for="pickers5">Oranges</label>
<cfinput id="pickers6" name="pickmany" type="checkbox" value="Mangoes">
<label for="pickers6">Mangoes</label>
<br/>
<cfinput name="pickmany-selected" bind="{pickmany}"><br />
</cfform>
</body>
</html>
Most applications call a CFC function, or JavaScript function, or use a URL to make an HTTP request (typically to a
CFML page), and pass bind parameters as the function or URL parameters.
The following example uses the same form as the first example in the preceding section, but uses a different bind
expression with the following features:
• It uses the
events of the name and domain fields to trigger binding. So the e-mail field gets updated each time
keyup
that you enter a letter in any of these fields.
id
Last updated 1/20/2012
name
value that is used in the
label
866
attribute but
tags, you click

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents