Example: CFML for a skinnable XML form

The following CFML code creates the form shown in the figure in About XML skinnable forms. It shows how you can use CFML to structure your form.

<cfform name="comments" format="xml" skin="basiccss" width="400" preservedata="Yes" >
   <cfinput type="hidden" name="revision" value="12a">
   <cfformgroup type="fieldset" label="Basic Information">
      <cfformgroup type="vertical">
      <cfformgroup type="horizontal" label="Name">
         <cfinput type="text" size="20" name="firstname" required="yes">
         <cfinput type="text" size="25" name="lastname" required="yes">
      </cfformgroup>
      <cfinput type="text" name="email" label="E-mail" validate="email" maxlength="35">
      <cfselect name="satisfaction" style="width:120px" multiple="false" label="Satisfaction">
         <option selected>very satisfied</option>
         <option>somewhat satisfied</option>
         <option>somewhat dissatisfied</option>
         <option>very dissatisfied</option>
         <option>no opinion</option>
      </cfselect>
      </cfformgroup>
    </cfformgroup>
   <cfformitem name="html1" type="html">
   <p><b>We value your input</b>.<br>
   <em>Please tell us a little about yourself and your thoughts.</em></p>
   </cfformitem>
   <cftextarea name="thoughts" label="Additional Comments" rows="5" cols="66">We really want to hear from you!</cftextarea>
   <cfformgroup type="horizontal">
      <cfinput type="submit" name="submit" style="width:80" value="Tell Us">
      <cfinput type="reset" name="reset" style="width:80" value="Clear Fields">
   </cfformgroup>
</cfform>

View comments in LiveDocs