Created
February 23, 2012 23:33
-
-
Save chrisdpeters/1895719 to your computer and use it in GitHub Desktop.
Setting Global Defaults in CFWheels for Cleaner Form Code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
#startFormTag(action="save")# | |
#textField(label="Name", objectName="user", property="name")# | |
#textField(label="Email", objectName="user", property="email")# | |
<div>#submitTag()#</div> | |
#endFormTag()# | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="/user/save" method="post"> | |
<div> | |
<label for="name">Name</label><br /> | |
<input id="name" name="name" /> | |
</div> | |
<div> | |
<label for="email">Email</label><br /> | |
<input id="email" name="email" /> | |
</div> | |
<div> | |
<input type="submit" value="Save Changes" /> | |
</div> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfoutput> | |
#startFormTag(action="save")# | |
<div>#textField(label="Name", objectName="user", property="name", wrapLabel=false, appendToLabel="<br />")#</div> | |
<div>#textField(label="Email", objectName="user", property="email", wrapLabel=false, appendToLabel="<br />")#</div> | |
<div>#submitTag()#</div> | |
#endFormTag()# | |
</cfoutput> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfset set(functionName="textField", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- Form helpers ---> | |
<cfset set(functionName="textField", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> | |
<cfset set(functionName="passwordField", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> | |
<cfset set(functionName="fileField", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> | |
<cfset set(functionName="fileFieldTag", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> | |
<cfset set(functionName="select", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> | |
<cfset set(functionName="selectTag", prependToLabel="<div>", append="</div>")> | |
<cfset set(functionName="textArea", appendToLabel="<br />", wrapLabel=false, prependToLabel="<div>", append="</div>")> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment