The <CFTEXTINPUT> Tag

This tag is the hot-rodded relative to both HTML's <INPUT TYPE="text"> and ColdFusion's <CFINPUT TYPE="text">. Like the other tags, it uses JavaScript to work its magic behind the scenes, but <CFTEXTINPUT> takes things a step further by creating the entire input box as a JavaScript function.

What does this mean to you, the developer? It means more control over the way your text input boxes look on the page. With <CFTEXTINPUT> you can customize the font, text color, and box color of your text input elements. Let's look at an example in Figure 11.4.

Figure 11.4. Three types of input boxes, each generated by different code.

The first box in Figure 11.4 comes from a standard HTML <FORM> tag:

 <INPUT TYPE="text" NAME="HTML"> ...

Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.