Tag Documentation

cf_sebForm

Description

cf_sebForm provides a simple interface to handle client-side validation and server-side validation. It can also handle simple CRUD interactions with a database or send email. Alternatively, it can call a specified component method after handling validation. The output of cf_sebForm can be skinned and/or customized.

Attributes

Action Type: (all) table | email | CFC | form
Data Retrieval Method: (all) table | query | CFC
(use above links to show only relevant attributes)

Attribute

Req/Opt

Default

Description

formname

optional

 

A name for the form.

name

optional

 

Shortcut for the "formname" attribute.

id

optional

 

The "id" attribute for the form.

forward

required

 

The url (absolute or relative) of the page that the user should be forwarded to upon completion of the form submission.

librarypath

optional

/lib/

The URL of the client-side script files.

skin

optional

 

The skin used by cf_sebForm (from librarypath/skins). Current options are [carpediem,graybar,panels,plain]. You can also make your own skin (see below)

skinpath

optional

#attributes.librarypath#skins/

The path to the CSS files for each skin.

skins

optional

 

An optional structure to define any custom skins. Each key name should match the name of the skin being defined. Each key should be a structure defining attribute names with default values for the skin.

format

optional

semantic

Set format of form. If a format is provided by the skin, that will be used if set here. Config attribute will override format attribute.

  • semantic
  • table

objname

optional

jsqForm

The name of the qforms object for this form. You must set this manually if you plan to have more than one cf_sebForm on the same page.

email

optional

 

If provided, the email address to which cf_sebForm will send the results of a form submission.

mailserver

optional

 

Required if email is provided. The mailserver that cf_sebForm will use to send an email message.

emailfrom

optional

 

See Description The from address for the email message sent by cf_sebForm (if email is populated). Defaults to the value provided in the email attribute.

Mailer

optional

 

An instantiated Mailer.cfc component. If this is passed in then cf_sebForm will send mail using this component instead of cfmail.

config

optional

 

An optional structure that can be passed in to change the output by cf_sebForm.

validations

optional

 

An optional structure to define any custom validations. Each key name should match the value of the "type" attribute used to indicate this type. The value of each key should be the regular expression to validate that type.

enctype

optional

 

Sets the enctype attribute of the form tag. Note that you do not generally need to set this attribute as cf_sebForm will automatically set it to the correct value for a file upload if one is present.

method

optional

post

This is the same as the method attribute in a <form> tag.

  • get
  • post

filter

optional

 

A component with a filter method. If passed, then the filter method will be passed the Form structure and sebForm will set the form structure to the result returned by that method. Optionally, pass in an array of components.

emailCC

optional

 

Email address to CC (carbon copy) on email sent from cf_sebForm (only used if email and emailFrom are provided).

emailBCC

optional

 

Email address to BCC (blind carbon copy) on email sent from cf_sebForm (only used if email and emailfrom are provided).

Subject

optional

Form Submission

Subject of email sent from cf_sebForm (only used if email and emailfrom are provided)

UploadFilePath

optional

 

The root system path for files uploaded using sebForm (in conjunction with "folder" attribute of sebField).

UploadBrowserPath

optional

 

The root browser path for files uploaded using sebForm (in conjunction with "folder" attribute of sebField).

sendforward

optional

true

Determines if cf_sebForm should forward user to page indicated with forward attribute after taking action.

sendback

optional

false

If "sendforward" and "sendback" are both true, then the "forward" attribute will default to the page from which the user came to the sebForm page.

emailtype

optional

 

The type of email sent from the form (html/text).

replyto

optional

 

The email address to which replies should be sent for any email sent by cf_sebForm (replies to from address if not specified).

CatchErrTypes

optional

 

A list of error-types that should be caught by cf_sebForm as part of server-side validation.

debug

optional

false

Normally sebForm will suppress errors retrieving data for the form. Set debug=true to have it rethrow any errors retrieving data for the form.

returnvar

optional

sebForm

The name of a variables returned by sebForm with information about the form.