1. <cfoutput>#DateFormat(Now(), "m-dd-yyy")#</cfoutput>
  2. DSL form declaration:<br />
  3. <pre>
  4. form:submitLogin
  5. User Name, username, text, 32, required, 2
  6. Password, password, text, 32, required, 2
  7. Boy, sex, radio, 0, required, 2
  8. Girl, sex, radio, 0, required, 2
  9. button:Submit Login &raquo;
  10. </pre>
  11. <cfsavecontent variable="dslFragment">
  12. form:submitLogin
  13. User Name, username, text, 32, required, 2
  14. Password, password, text, 32, required, 2
  15. Boy, sex, radio, 0, required, 2
  16. Girl, sex, radio, 0, required, 2
  17. button:Submit Login &raquo;
  18. </cfsavecontent>
  19. <cfsavecontent variable="gereratedFrom">
  20. <cfoutput>
  21. <!--- loop over the DSL fragment and generate the form --->
  22. <cfloop index="x" list="#dslFragment#" delimiters="#chr(13)##chr(10)#">
  23.     
  24.     <!--- if it is the form declaration, handel --->
  25.     <cfif x contains "form">
  26.         <form accept="#replace(x, "form:", "","all")#">
  27.     
  28.     <!--- if it is an input type --->
  29.     <cfelseif x DOES NOT CONTAIN "button">
  30.         <div class="formElement">
  31.             <label for="#listgetat(x, 2)#">#listgetat(x, 1)#</label>
  32.             <input type="#trim(listgetat(x, 3))#" name="#trim(listgetat(x, 2))#" maxlength="#trim(listGetAt(x, 4))#">
  33.         </div>
  34.         
  35.     <!--- not a from declaration or input type so, it must be a button --->
  36.     <cfelse>
  37.         <input type="submit" value="#trim(listGetAt(x, 2, ":"))#">
  38.     </cfif>
  39.     
  40. </cfloop>
  41. </cfoutput>
  42. </cfsavecontent>
  43. <cfoutput>#gereratedFrom#</cfoutput>