If true, this control will attempt to focus itself after the page has loaded. Note that only one element may be focused on the page at a time.
Default = false
- `dataColumn`
Sets the data column
The datacolumn links the form item to a key used when getting or saving from a component (as defined by the parent form).
- `disabled`
bool
Disable Input
Disables the input, preventing user interaction
- `height`
string
Height
Sets the height of the element. The default units are pixels. include the percentage symbol % to user percentage values.
- `id`
string
Most form items need a unique id so that they can submit data to the server. No two form items may have the same id. For situations where multiple form items submit to the same field, see the name attribute. Id's that begin with contact_ will automatically save Contact information to the Contact database as long as the user has entered enough identifying information (ideally Name and Email). Check the Contact Fields page for correct field names.
- `mustBeSameAs`
string
Id of another password input that this one should have the same value as.
- `name`
string
Sets the name of the form item. Most of the time, the id attribute will suffice. However, with form items that post multiple values into an array, each item will need to have the same name, followed by []. For example three controls with name="data[]", will all post into 'data'.
Radio buttons belonging to the same group will have to share the same name.
An empty name="" leaves the item unnamed, so the browser never posts it to the server (e.g. card fields a payment gateway tokenizes in the browser).
- `saveState`
bool
Restore state on reload
Whether the value of the input persists when the page is revisited.
Default = false
- `showStrength`
bool
Indicate Password Strength
Set to true if requiring a password strength indicator
- `transformations`
Value Transformations
Sets the value transformations to be applied to the value of the form item as a comma separated string.
- `validations`
Validations
Sets the validations to be applied to the value of the form item as a comma separated string.
Eg: validations="mandatory"
When no validations attribute value is set, the form item is optional.
- `width`
string
Width
Sets the width of the element. The default units are pixels. include the percentage symbol % to user percentage values.
Tutorials
By editing the settings of a page, you can specify that access should be restricted to contacts who meet certain conditions (more
here).
Automation can be used to place contacts into groups after form submissions, and you can add a password field to signup forms to allow
contacts to set a password.
You can also code your own login forms and restrict access to certain pages or content if you wish. The following article shows a typical
implementation of a login form on a Oncord powered website.
Determining Whether a User is Logged in
The <logic:if> control allows you to check whether a user is currently logged into the website. This will allow us to display
different content to users, depending on whether they are logged into the website.
<logic:if test="\Components\Customers\Contacts::currentIsLoggedIn()">
<p>Content to display if the user is logged in</p>
</logic:if>
<logic:else>
<p>Content to display if the user is not logged in</p>
</logic:else>
The Login Form
The following code is a common implementation of a login form, wrapped in the above <logic:if> tag to determine whether a user is
logged in:
<logic:if test="\Components\Customers\Contacts::currentIsLoggedIn()">
You are currently logged in as <strong><personalisation:fullname /></strong><br />
<br />
If you would like to change your login information, please choose from the options below.<br />
<br />
- <a href="/community/profile/">My Profile</a><br />
- <a href="/community/logout/" onclick="return confirm('Are you sure you wish to logout?\n\nYou only need to logout if you are using a public computer and are concerned about your privacy.\nUnlike some sites, this site does not require you to logout after each session.');">Logout</a>
</logic:if>
<logic:else>
<forms:form contactmode="login">
<forms:editbox placeholder="E-mail" validations="mandatory,email" id="contact_email" />
<forms:password placeholder="Password" validations="mandatory" id="contact_password" />
<forms:submitbutton value="Login" />
</forms:form>
<br />
<a href="/community/lost_password/">Lost / Forgot Password</a>
</logic:else>
Examples
Registration Form
Demonstrates a registration form with confirm password field