phdcc.Data DNN modules
Powered by FindinSite-MS
phdcc.Data.Form: Edit Form
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 22/12/10


Use the phdcc.Data.Form module menu "Edit Form" to edit your form's contents. The editor is not WYSIWYG but does allow you to set up all the form - and different language translations. To use this screen you must have edit permission, eg be the portal administrator; you must be in Edit mode for a page to access the module menu in the container.

The form editor has a top section which has details about the whole form. For the main part of the form, you must choose a locale to work in, eg English. So you might first add questions to a form in English. Later you might add a French locale and then go through the form translating the English text into French.

Click on the various 'Store' links when you have made changes. Any changes that you make to a form are only committed when you click on 'Update' at the bottom of the screen.

Note that the form editor itself only ever uses English prompts.

Module container

Each instance of a form module can contain only one form.

You can opt whether or not to show the module container. Remember that the form module shows a title and help text in the form header - so you might decide against showing the container.

It is useful for the user if pressing the Enter key will submit the form. If you do show the module container and the container has a print action then pressing Enter may try to print page, which is not expected.

Form contents

phdcc.Data form layout diagram

The form editor lets you specify the contents of a form. You can set simple option placements but - in general - this editor does not let you change the form layout - see the layout page for details of how to do this.

In the form editor you specify :

Note that the editor is general purpose, so some edit options might not be relevant in the context.

ID names

A key concept to understand is that each form and its elements are identified by "string ID names" which YOU must make up, eg:

If you look at the results tables directly, then you might see the following for one result set of the "idSurvey" form:

A ID name must not contain spaces and must be no longer than 50 characters. Within a form, the editor stops you from using the same ID name more than once.

Each form has its own set of ID names so different forms can safely have different values for the same ID name. However, for Profile forms, the results are shared for forms with the same form ID name - see Profile/Register forms.

ID name localisation and translation

Using "string ID names" to identify the form elements and results is the key to making it possible to localise the form for users. Each ID name has one or more translations stored in the string table for each form.

When you use the "Edit Form" screen to design your form, you will make up ID names for each form element. You will assign actual text values to them for the default locale which is English. Having completed the form in English, you can then add a new locale for the form and go through the form, eg filling in all the German string values.

Using the Form Editor

Use this screen to build or edit a form, following these instrructions:

Form fields:

Form id: Choose an identifier name for your form, eg 'idProfile'
Default language code: Enter the default locale code. Leave as "en" for English or choose another two letter lower-case language code (iso639.txt), optionally followed by a hyphen and a two letter upper-case country code (ISO_3166.html) eg "es" or "en-GB".
Form type: Choose 'Recordset' to allow a user to fill a form in many times. Or 'Profile' if the form stores persistent profile data for a user. Or 'Profile/Register' if the profile form is used to create a user. More info
User must be logged on: Tick if the user must be logged in to use the form
Results must be authorised: Tick if the results must be authorised before they can be viewed or listed
Email results to: The email address to send the form results.
Thank you page: To show a different page when the form is successfully filled in, select a DNN page from the list. Or select "Other URL in the box below" and enter you desired URL below.
Form hook control: The optional VB or C# programmer form event hook control file, in DesktopModules/phdcc.Data.Form with extension .ascx - see here about form hooks
CSS file: Choose your optional .css file in the DesktopModules\phdcc.Data.Form directory

Localised special strings

idLocale English
idDefaultBoxColumns 35
idDefaultBoxRows 5
idAmend You have already filled in this form.
idRequired * You must answer this question
idNotValidated Sorry, please fill in and check the fields below
idThankYou Thank you. We will get back to you shortly.
idSubmit Submit
idFormNotLoggedIn Not logged in
idForceRegistration <br />This form will register you at this site. If you are already registered, please log in first.
idRegisterEmailExists There is already a user with this email. Either login or use a different email address.
idFormSendEmailError Sorry, there was an error sending an email with your form answers - if need be, please contact the site administrator.
idRegisterSendEmailError Sorry, there was an error sending your registration email - please contact the site administrator.
idCountryNotSpecified Not specified
idAnswerRequired required
idAnswerOutOfRange Answer not in range {0:d} to {1:d}
idAnswerBadLength Answer should have length between {0:d} and {1:d}
idAnswerNotAnInteger Answer not a number or number too big
idAnswerBadEmail Answer is not an email
idAnswerBadUsername Answer is not a valid Username: use alphanumeric, underscore and hyphen characters.
idAnswerCurrencyNotValid Answer not a valid currency value
idAnswerCaptchaFail Answer did not match challenge
idAnswerHTMLFail Answer cannot contain any HTML or script code
idAnswerBadFileExtension File type is not accepted: bad file extension
idAnswerBadImage Uploaded file is not recognised as an image
idAnswerRadiobuttonSpecifyMismatch1 Please select the radiobutton or clear the text
idAnswerRadiobuttonSpecifyMismatch2 Please provide some text if you have selected this option
idAnswerCheckboxSpecifyMismatch1 Please tick the checkbox or clear the text
idAnswerCheckboxSpecifyMismatch2 Please provide some text if you have ticked this box