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

Set the value of Dropdown with Auto Complete

Mark Buelsing 0 3154 Article rating: No rating

Use this function to set the value of a dropdown with auto complete

function setAutocompletCurrentValue(id, value) {
   $(id).val(value);
   var textToShow = $(id).find(":selected").text();
   $(id).parent().find("span").find("input").val(textToShow);
}

Called like this:

setAutocompletCurrentValue(dnn843GCSFieldName, 'test');

Notes:

The value you set it to must be a correct choice for the control from its dataset,

Not sure if the single quotes are needed or not.

Prevent a Form Submit

Mark Buelsing 0 0 Article rating: No rating

To prevent a page refresh you have 3 options:

If you are working with a button.

1. return false  - on change/click  - which will stop execution of all actions on the button (as the on change/click javascript executes first)

2. return false; - but move it from the on change/click area to an Execute JavaScript action which you place as the last action on the submit button

3. Update Form AJAX as the last action on the button; this will submit and then refresh your form without refreshing the page.

Set initial date of Date Time Picker for a future date

Mark Buelsing 0 2651 Article rating: No rating

To create a date 2 weeks in the future, simply use the following token: [DateTime:Relative(Add="2 Week")|yyyy-MM-dd] for the Initial Value setting.

If you are getting your date from SQL, for the "Initial" value ... what I have used successfully from SQL DateTime retreived fields is the following: [MyVariable:ISOAsUtc]

From Ben Santiardo

https://community.plantanapp.com/Forum/Question-Details?qid=1388

Open Form in Popup With Querystring Parameters

Mark Buelsing 0 2948 Article rating: 5.0

Using the javascript API you can open Action Form in popup by calling the next javascript method

dnnsf.api.actionForm.openPopupById('1234', {'param':'valueofparam','param2':'valueofparam2'},true)

 

Also works for simply initializing a form already on the page

dnnsf.api.actionForm.initForm('1234', {'param':'valueofparam','param2':’valueofparam2'})

Get Text from Chosen Item in Multiple Choice Before Submit

Mark Buelsing 0 2647 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.

RSS
12345678