22.08.2013 Views

ColdFusion Developer's Guide

ColdFusion Developer's Guide

ColdFusion Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Beta Beta Beta Beta Beta Beta Beta Beta Beta Beta<br />

■ Adding a validation rule to a field does not make it a required field. You must add a<br />

separate _required hidden field to ensure user entry.<br />

Hidden form field example<br />

The following procedure creates a simple form for entering a start date and a salary. It uses<br />

hidden fields to ensure that you enter data and that the data is in the right format.<br />

This example uses a self-submitting form; the same <strong>ColdFusion</strong> page is both the form page<br />

and its action page. The page uses an IsDefined function to check that form data has been<br />

submitted. This way, the pages does not show any results until you submit the input. The<br />

form uses HTML tags only; you can substitute these tags with the CFML equivalents.<br />

<br />

<br />

Simple Data Form<br />

<br />

<br />

Simple Data Form<br />

<br />

<br />

<br />

<br />

<br />

<br />

Start Date:<br />

<br />

Salary:<br />

<br />

<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!