![]() |
|
|
Formulate
Project Home • Blog • Forums • Known Issues • Contact Project
Author: Lu Sancea (All RIAForge projects by this author) Description:
After working on a project where I was creating a new form every few hours I got annoyed. Formulate is a basic group of methods than take in regular HTML input attributes and renders the form elements using a css based layout. The form elements have are returned with the spry widgets created, all you have to do is include the css and js files in the header and that's about it. Here is an example of how this works.
<cfhtmlhead text=" <script src='SpryAssets/SpryValidationTextField.js' type='text/javascript'></script> <link href='SpryAssets/SpryValidationTextField.css' rel='stylesheet' type='text/css' /> "> <cfscript> formulator = createObject("component","objects.form").init(); newFrm = StructNew(); newFrm.name = "frm"; newFrm.action = "#cgi.SCRIPT_NAME#"; newFrm.method = "post"; newFrm.elementClass = ""; newFrm.elementId = ""; newFrm.formElements = ArrayNew(1); /* Form Elements are in this order: Element Label, Element Type, Element Name, Element Value, Element Value Label, Element Size, Element Max Length */ newFrm.formElements[1] = "label:Username|type:text|name:jusername|value:|valueLabel:|size:30|maxLength:30|required:true|reqMessage:Username is required"; newFrm.formElements[2] = "label:Password|type:password|name:jpassword|value:|valueLabel:|size:30|maxLength:30|required:true|reqMessage:Password is required"; newFrm.formElements[3] = "label:|type:submit|value:Log In"; </cfscript> <cfoutput>#formulator.generateCssForm(variables.newFrm)#</cfoutput>
Requirements:
CFMX7
CSS Issue Tracker: There are no issues for this project. To enter issues for this (or any other) project, you must be logged in. |
||||||||||||||||||||||||||||
Adobe and the Adobe product names are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other countries.