XMod 4 completely revamps the editor used in previous versions. In this new iteration, we've tried to make the process of creating forms much simpler while still allowing power users the freedom and flexibility they enjoyed in previous versions.
When you first open the Form Editor, you'll see a screen with three basic options:
Create New Form: Choose this option to create a new data-entry form. Click the Create New Form link to continue to the Form Settings and Permissions panel.
Edit Form: Choose this option to edit an existing form and then select the form you'd like to edit from the drop-down list to the right of the option. Finally, click the Edit Form link to continue. Doing so will take you to the Editor panel.
Delete Form: Choose this option to delete an existing form and select the form you'd like to delete from the list to the right. Click the Delete Form link to delete the form. You'll be prompted to confirm the deletion. Please be aware that this action is irreversible.
If you haven't yet created a form then the options to Edit and Delete forms will be disabled.
The Form Settings and Permissions panel is where you define the basic properties of the form, including its name, the type of form it will be, and security settings. You can reach this panel as the first step in creating a new form and also by clicking the "Settings" link on the Editor panel:
Form Name: Each form must be given a name. This can be virtually anything you want. The purpose of the name is to identify it to you and those users who work with the form.
Form Type: This is where you tell XMod what type of form it will be. There are currently 3 types of form that XMod understands:
Auto-Layout: This is the best type of form to select if you're new to XMod or if you want to create a quick form. With this type of form, you only need to define the controls to place on the form. XMod will automatically generate the HTML code and the control captions.
Benefits: Quick form creation, no HTML needed.
Disadvantages: No control over layout.
Custom HTML Layout: Once you've become more comfortable with XMod, you'll probably choose this option most of the time. Custom HTML Layout forms allow you to use your HTML skills to control the layout, format, and design of your form. You define form controls in the same way you do for Auto Layout forms. Whenever you need to insert HTML, you simply enclose them in <literal> </literal> tag pairs. You'll also want to choose this form type if you'll be using Javascript to any great degree.
Benefits: Complete control over layout, formatting, and design of the form; greater ability to inject Javascript functionality.
Disadvantages: At least a basic knowledge of HTML is required. Creating custom forms is more time-consuming that auto-layout forms.
ASCX-Based Form: This last form type is for ASP.NET developers. It allows you to create a custom user control (an ASCX file) and use that as your data-entry form. This option provides the most flexibility and power since you can use your full ASP.NET development toolset and skills to craft the form. When you choose this type of form, you don't define controls in the form's editor. Rather you tell XMod the control names and what type of controls they are (single-value or multi-value fields) using <field> tags. See the sample ASCX-Based Form project included with the XMod download for sample code.
Benefits: Provides the maximum flexibility and power by allowing you to leverage your ASP.NET development skills, ASP.NET controls, and even 3rd party custom ASP.NET controls. Allows you to concentrate on the UI and other business logic while XMod handles the data. Also, since you are creating an ASCX form, you not prevented from accessing non-XMod data sources - though you will be responsible for the interaction with those sources.
Disadvantages: More complex and time-consuming than either the Custom HTML or the Auto Layout form types.
Security: There are some situations in which you want to restrict the user to only being able to submit one record (user profiles is one such scenario). Check this box to enable this feature. Note that you should ensure that a user cannot access the data-entry form until he/she is logged in since this feature is keyed on the user's DNN ID. Otherwise, the feature will not function correctly.
Item Approval: If you are creating a solution in which data entered by users should be viewed and approved prior to that data being displayed, you should select the "Require Approval" option in this box. If you choose "No Approval Required", all data entered will be automatically marked as approved and will be visible upon submission (subject to content scheduling). When you select "Require Approval", additional settings become available:
User Moderation: If you have chosen to require approval for records entered via this form, XMod provides you with a lot of flexibility regarding what the "Add User" (the person who is listed as having created the record) can do. Before a record has been approved, you can choose to allow/disallow the Add User's ability to edit and/or delete the record; you can allow/disallow the Add User's ability to edit/delete the record after it has been approved; and if the user is allowed to edit the record after it has been approved, you can specify that the record must be reviewed and approved again, before being made public.
Approval Roles: Check the box next to each role whose member you want to be able to approve and un-approve records entered via this form.
Auto-Approve Roles: Some roles may not need to be reviewed and approved (i.e. the Administrator of the site or the Content Editor). Check the box next to each role that falls in this category.
This is a screen shot of the form editor. It consists of a toolbar, an editing area, and a Save and Cancel button. Details on each section of the panel are provided below the screen shot.
Form Control: Select the control you'd like to insert from this list of common controls, such as Text Box, Text Area, Single-Select List, etc. and click the Add button. When you do so, that control's tag designer will pop-up, enabling you to easily set the control's properties.
XMod Constant: XMod forms provide you with the ability to use environmental data - data that exists only when the form is being viewed such as information about the user (DNN User ID, First and Last name, etc), the user's IP address, the portal's ID, and more. Select an item from this list, click the Add button and XMod will insert a placeholder representing the data. The placeholder will be replaced at run-time with the actual data.
Preview: This time-saving feature allows you to see what your form will look like before saving your changes. Since this is a preview and not a fully "live" version of your form, there may be certain form features that do not function (like the Add and Cancel buttons). However, in many cases you should see a fairly accurate representation of your form's look and behavior.
Reset: If you make a mistake and would like to start over, clicking this will re-load your form from the database if you're editing a form or will revert back to the "starter" code if you're creating a new form. Please note that you will lose any changes you've made.
Format Code: When clicked this will indent your code, making it easier to read in most cases. Since XMod forms are well-formed XML, the function will only work with valid XML and will notify you if the form is invalid XML.
Settings: Click this to edit your form's general information (such as name) as well as its security and approval options. See Form Settings for more details.
Editing Area: This is where you define the form. XMod forms are XML documents that begin with a <form> tag and end with a </form> tag. Your form's controls should be placed inside the <controls> and </controls> tags. Use the drop-down form control list to design your controls.
Save Form/Cancel Buttons: When you are satisfied with the changes you've made, click the Save Form button. If you'd like to abandon this editing session and return to the Starting panel, click Cancel.