DNN Custom Forms by OnyakTech
OnyakTech Custom Forms DNN Module
by OnyakTech

OnyakTech Forms DNN Module Control Panel

Each control on your form has it's own set of properties that define how the control looks, what it can do, how it's loaded with data, what values people can enter into it, if it triggers a product to be added to the shopping cart, how it maps to other modules, what field it is mapped to in PDF Templates and much more. A lot of these properties can be set using Tokens in your Form Template but the best way to set them is using the Control Panel.

To access the properties of a control on your form using the Control Panel, first select the control in the Controls List and then click the link to Open the Control Panel for the selected control.

DNN Forms DNN Module Control Panel

Data Options

Default Value from Profile: To have a user profile value loaded into the control when the user is logged into your DNN web site you can select the profile field in this list. If the user is not logged in this will not do anything.

Placeholder: This can be used with Textbox controls to display a hint to the user indicating what information is expected to be typed into the control.

Default Value: Sets the default value for this control and should return a single value. For direct values, enter the values delimited by a semi-colon (EX: Yes;No;Maybe). For SQL, type TSQL statement here with tokens or just type a token for the direct value. Ex: [Now] Ex: Select Email From Users Where UserId=[User:UserId]

List Contents: For List control types only and should return a list of items. If this value is empty then the Default Value contents will be used instead. To set direct values, enter the values delimited by a semi-colon (EX: Yes;No;Maybe). For SQL, type TSQL statement here with tokens or just type a token for the direct value. Ex: [Now] Ex: Select Email From Users Where UserId=[User:UserId]

SQL Validations: SQL Validations executed TSQL you define for non-exists, exists and return count to validate the value entered for the control based on custom SQL you provide and the condition you use. For example if you wanted to prevent people from entering an Invoice ID for an Invoice that was already paid you would use these options to check the status of the Invoice ID entered into the control.

Grid Column Styles: If this control is a Data Grid then you can set CSS Styles for specific columns by indicating the column index=CSS Style, each column delimited by a pipe "|". Example format: columnind ex=width:50px;color:black;|columnindex2=width:20px; or another example is 5=width:200px;

Roles: The Role options make it possible to grant a user access to a DNN Role based on a the value they enter into the control. You can set the value expected and the Role to grant to the users profile.

Redirect if True: If this control is a checkbox you can set a URL to redirect the user to if the checkbox is checked. This overrides all other redirects set in Display Setup.

Input Validation Options

Roles Visible To: If you select a role in this option the control will only be visible to people in the role you select.

REGEX: In this option you can enter a regular expression to validate the values entered into this control. It is best to use this for field validation instead of the Required Value token.

Error Message: This is the message displayed if the REGEX validation fails. Leave it empty to use the default message.

Matching Control: To have the value entered into this control match the value entered into another control on your form you will enter the name of the other control for this option.

Is Required: Check this option to require the user to enter a value into this control before they can submit the form.

Store Product Options

These options are only used if you have checked the option to enable the Forms Store in Display Setup. These are not used with the AuthorizeNet Subscription options and when using these options you can use the standard SUBMIT button token. When using the Authorizenet Subscription feature you will use the SUBMITPURCHASE button.

Is Product: Check this option if the current control should trigger a purchase.

Product Name: Enter the name of the product this control should be connected with. This name will appear in the shopping cart, emails and all invoices.

Price: Enter the price for the product into this option, do not include the currency symbol.

Control Styling Options

The Control Styling options provide additional features to add a mask, visual glow, tooltips and even your own custom JavaScript specific to the control.

To use these features, select the options you want to add and click "Generate Script from Options Above". The Forms DNN module will then generate the script for you and it to your control. You can then modify the script as needed.

All controls on your form are given the CSS class based on the name of the control prefixed with CSS. To reference the control CSS in your script you can use ".CONTROLCSSNAME" which will be converted into the actual CSS class assigned to the control when the form is rendered.
PDF Form Template Mapping

When you enable the PDF Template Merge the fields in your PDF Template are mapped automatically to fields in your PDF document based on the control name. If you are unable to map the control to have the same name as the control in your PDF document then you can enter the field name in your PDF that you wish to merge the current controls value to in this section of the Control Panel.

SigmaPro Options

These options are specific to SigmaPro when integrating the OnyakTech Custom Forms module with the SigmaPro DNN module. Making it easy to create your own custom forms for submitting and working with help desk tickets and projects.

Notes: You can also set default control values to include Tokens. See "Sample Default Values" form for examples.

Loading Controls from SQL: Some of the controls can be loaded with SQL in the "Default Value" above in the Data Options section.  If they are of list type (listbox, dropdown, etc) then you can select two fields that will represent the value and text to be displayed in the control.  For example “Select UserId, UserName From Users” will load a listbox with the User ID as the list items value and the User Name will be displayed.  When the values are saved to CSV or directly into the database only the value will be stored.  If you want to store the User Name and you don’t really care about setting the value then you can just select one column (Ex: Select UserName From Users). Only the "Value" is stored and included in email templates and redirects.

  • SINGLE VALUE: To load a list control that contains the same key/value you will enter a SELECT statement that pulls just one column.  EXAMPLE: Select UserName From users.
  • KEY/VALUE PAIR: To load a list control that contains a separate key and value you will enter a SELECT statement that pull two columns.  All other columns are ignored.  Columns must be in the order of Key, Value. EXAMPLE: Select UserId, UserName from Users.


Tip: The SQL feature accepts tokens will be dynamically replaced with the token value you specify. For example, the following SQL will return the current Portal ID and current date and time: Select [PORTALID] as Portal, [NOW] as MyTime. Try this out by using this SQL Example in the SQL option in the Data Options section above.

Group Expressions: If your form template contains the [DATAGRID2-xxx] control then you can add a Group Expression to the "Default Value from SQL" by delimiting the value with a semi-colon and then the group expression. Format: sql;groupexpression. DATAGRID2 uses default CSS styling set from the module.css.

Group Expressions:

  • Creating group-by expressions, testing expressions syntax:
  • Expression syntax: fieldname[ alias]|aggregate(fieldname)[ alias][, ...] This example demonstrates how GroupByExpressions can be used:
    • Creating group-by expressions, testing expressions syntax:
    • Expression syntax: fieldname[ alias]|aggregate(fieldname)[ alias][, ...] Group By fieldname[ sort][, ...]
      Where:
      fieldname
      : name of any field from the DataSource
      alias
      : alias string. This cannot contain blanks or other reserved symbols like ',', '.' etc.
      aggregate
      : any of - min, max, sum, count, last, first etc (the same as in GridAggregateFunction enumeration)
      sort
      : acs or desc - the sort order of the grouped items
          Example: Country, City, count(Country) Items, ContactName Group By Country, City desc  
    • Displaying additional information in each group header - like aggregate fields
    • Dynamically add a "SubTotal" to each group, handling grid's grouping events
    up By fieldname[ sort][, ...]
    Where:
    fieldname
    : name of any field from the DataSource
    alias
    : alias string. This cannot contain blanks or other reserved symbols like ',', '.' etc.
    aggregate
    : any of - min, max, sum, count, last, first etc (the same as in GridAggregateFunction enumeration)
    sort
    : acs or desc - the sort order of the grouped items
        Example: Country, City, count(Country) Items, ContactName Group By Country, City desc  
  • Displaying additional information in each group header - like aggregate fields
  • Dynamically add a "SubTotal" to each group, handling grid's grouping events

The following tokens can be used in your SQL to create dynamic parameter values.  To have new tokens added, contact Support@OnyakTech.com

Token Description
[User:DisplayName] User's Display Name
[User:Email] User's Email Address
[User:FirstName] User's First Name
[User:LastName] User's Last Name
[User:UserName] User's Login User Name
[User:UserId] User's System ID