phdcc.Data DNN modules
  search
Powered by FindinSite-MS
phdcc.Data.Form: Profile/Register forms
phdcc.Data: Overview Examples Getting Started Security Database Versions
phdcc.Data.Form: Form Profile/Register forms Form editing Languages Layout Questions Form hooks Admin
phdcc.Data.View: View  phdcc.Data.List: List phdcc.Data.Search: Search
Last updated: CC 12/3/08

Form types

Each form instance asks a user for answers to one or more questions. The questions and answers are stored in DNN database tables managed by phdcc.Data. You can optionally link questions to standard DNN Profile Properties.

Recordset forms The form results are stored each time anyone fills in the form.
Profile forms The results are stored as a profile for each user - and can be updated etc.
The profile form questions/answers can optionally be linked to standard DNN profile property fields.
Register forms This will register a user if they are not logged on; otherwise it acts like a profile form.
To make this work, various questions must be linked to crucial DNN profile properties.
Email results When any valid results are entered, they can optionally be emailed to someone.

Profile forms

A profile is persistent information for a user. So 'Profile' forms remember the last values entered for a user. (By definition, a user must be logged in to use a Profile form.)

Register forms

'Profile/Register' forms work like 'Profile' forms, except that a new user can be registered if they are not logged in. Various questions must have certain linked DNN properties. See below for full details.

Recordset forms

A 'Recordset' form provides new information each time it is submitted. You do not have to be logged on to use a Recordset form, although you can set "User must be logged on" in the form editor if you want this.

Form default values

In the form editor, you can set default values for all form questions. (Various special default values are also supported, such as =UserInfo.Email - see Questions page.)

If question is linked to a DNN Profile Property (see below) and the user is logged in, then the current profile property value for a question is shown pre-filled; the profile property is updated when the form is submitted.

Results that must be Authorised

Normally you will want to moderate user submissions before displaying them. To do this, check the "Results must be authorised" checkbox in the form editor. After some forms have been submitted: in the form Admin box, click on the Moderate button - see the Admin page for more details.

A new resultset is stored when a form is moderated or amended by an administrator. The DateTime when the form was originally entered is stored in the "SubmitTime" answer, ie as the answer to a question with QuestionIdName "SubmitTime". In the View or List modules, you can access this value using Form("SubmitTime"). This DateTime is stored in RFC 1123 format, ie ddd, dd MMM yyyy HH':'mm':'ss 'GMT'.

Currently it is only possible to moderate 'Profile' form results.

Linked DNN profile properties

Form questions can be linked to DNN Profile Properties, ie those that appear in the DNN user profile page. Both standard profile properties and your custom properties can be used.

In the Form Editor, select a value for the Linked DNN property parameter - this is a dropdownlist containing all available properties, together with a default of "None".

For questions which have a Linked DNN property, the question's default value is taken from the DNN property. When the form is submitted and it validates, the user's answer updates the DNN property.

Be careful when you use a Linked DNN property that corresponds to important DNN user information. For example, if a question is linked to 'Display Name' or 'Email' then any changes will update the user's registration details. (There is special protection to make sure that the 'Username' cannot be changed.) As an alternative, you could for example set the question Default parameter to =UserInfo.Email - in this case, the user's registration email is not updated.

Using linked DNN properties lets you pass answers from one form to another.

Here is a partial list of the available DNN properties that you are likely to see:

Register forms

This is the logic that Register/profile forms use: