Menu

Action Form Notes

Action Form is a module developed by PlantAnApp for the DNN Content Management System and Development Platform. The developers at LetItShine.biz have used the Action Form module for countless projects and solutions for a number of years. The following is an modest collection of notes that we have started to record about techniques to take advantage of the strengths of this module. We record this here not to become a secondary help system for Action Form users or DNNSharp. But if you can find something here that helps you, that makes us happy too.

Return to the list

See if a Particular Option has been Checked

Test to see if one of the checkbox options has been checked.

Mark Buelsing 0 3530 Article rating: No rating

Say you have a checkbox field, and you want to know if a particular option has been checked. Here is the JS to do it.

Example:

Fieldname: ManagerList

Manager to test for: 33

Items currently checked: 33, 34

Syntax:   '[ManagerList]'.indexOf("33") != -1

This means, starting at position 0 in the string of chosen options, the position of the first occurance of "33" is not -1

Otherwise you could easily get

- [ManagerList] returns 33,34
- [ManagerList:JsonArray] returns ["33","34"]

------------

Also

I think you can use the syntax

[CheckboxList].includes('Other')

in the Bind Expressions / Show of the optional field.

See my repro - here

Get Text from Chosen Item in Multiple Choice Before Submit

Mark Buelsing 0 2648 Article rating: No rating

It appears that [Department:Text] is a backend-only token, meaning it can't be used on the fronted; however, you can do something along the lines of: on the dropdown field under Bind Expressions, On Change/Click use the following code:

form.fields.mytextbox.value = form.fields.dropdown.selected.text;

this will give the text box the value of the dropdown.

Set the value of a Multiple Choice in JS

Mark Buelsing 0 3032 Article rating: No rating

When you need to set the value of a Multiple Choice field from some other field's "On Change Click", this syntax works.

Multiple Choice Field Name: EnteringGrade2

Syntax: document.getElementById(form.fields.EnteringGrade2.id).selectedIndex = 0;

 

This syntax avoids using the actual field ID

The value of 0 is the default entry = "Select"

Send more columns of data through the Multiple Choice Dropdown

Action Form. Pack more data into your Multiple Choice Dropdown, unpack it when an option is chosen

Mark Buelsing 0 4523 Article rating: No rating

The multiple choice field has the value and the label. That's two columns of data on each row. When you really need more than two columns for each row, you can have it with some creative SQL and Javascript.

RSS