Required Fields v0.4

Use this plugin to append a marked up asterisk to the labels of required fields.

By default the added markup looks like this:

<span class="required">*</span>

Usage/Examples

The plugin will look at validations set on the object form helpers' properties to determine whether or not validatesPresenceOf() is set (manually or automatically).

You can override this by behavior when calling the form helper as well. Just set the required argument to true or false in the call to the form helper:

<!--- Force `name` field to required --->
#textField(objectName="category", property="name", required=true)#

<!--- Force `slug` field to optional --->
#textField(objectName="category", property="slug", required=false)#

You can also use this plugin with the form tag functions by manually adding the required argument.

<--- The "Tag" form helpers always need the `required` argument --->
#textFieldTag(name="Search", value=params.search, required=true)#

Configuration

You can modify some minor details of the required field indicator that appears. (By default, it is an asterisk.)

Just set the following variables in config/settings.cfm or events/onapplicationstart.cfm to override.

Setting Type Default Description
application.requiredFields.containerElement string span Container element around required field indicator.
application.requiredFields.containerClass string required Class set on container element around required field indicator.
application.requiredFields.indicatorText string * Required field indicator.

Uninstallation

To uninstall this plugin, simply delete the /plugins/RequiredFields-0.4.zip file.

Credits

This plugin was created by Chris Peters with support from Liquifusion Studios.

To submit an issue or fork this plugin, visit the liquifusion/cfwheels-required-fields repository on GitHub.

Warnings: The FallbackImage plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The LogUserAction plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The RequiredFields plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The JsonProperties plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The DefaultScope plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The Attachments plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The localerb plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The AssetBundler plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The PluginPackager plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
The inWords plugin may be incompatible with this version of Wheels, please look for a compatible version of the plugin
Application: AlexTasselV3 [Run Tests]
Framework: Wheels 1.1.8
CFML Engine: Adobe ColdFusion 9,0,1,274733
Default Data Source: alextassel
Active Environment: Design
URL Rewriting: On
URL Obfuscation: Off
Plugins: FallbackImage
LogUserAction
RequiredFields
DefaultScope
JsonProperties
simpleProperties
Attachments
AssetBundler
localerb
inWords
PluginPackager
Route: home
Controller: Wheels
Action: wheels
Additional Params: name = requiredfields
view = plugins
Caching Stats: hits: 0, misses: 0, culls: 0
Execution Time: 16ms (view ~16ms, action ~16ms)