Menu

Action Form Notes

Action Form is a module developed by DNNSharp.com 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

Remove blank from Multiple Choice

Mark Buelsing 0 0 Article rating: No rating

Multiple Choice fields have a blank entry in the list. I find that non-entry a confusing thing and don't want it there. It is usually the first item in the select list. You can remove it with code. Put a Static Text field on the form and paste the following JS. Change the ID's

 

<script>
// delete the blank entries in the combos
document.getElementById("dnn2244RTDecision1").options[0].remove();
document.getElementById("dnn2244RTDecision2").options[0].remove();
document.getElementById("dnn2244RTDecision3").options[0].remove();
document.getElementById("dnn2244RTDecision4").options[0].remove();
document.getElementById("dnn2244RTDecision5").options[0].remove();
</script>

 

******

A CSS:3 way to do this is to add the following style:

 option:empty{ display:none;} */Removes empty Multiple choice options /*

 

Set the value of a Multiple Choice in JS

Mark Buelsing 0 22 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"

How to refer to another field in JS

Mark Buelsing 0 0 Article rating: No rating
In Javascript, refer to another field like the following example for the field named, 

EndDate

$scope.form.fields.EndDate.value=(in30.getMonth() + 1) + '/' + in30.getDate() + '/' + in30.getFullYear();

Or, to use the ID of another field,

$('#'+form.fields.FillDirectInput.id).click();

Call DNN APIs

Using Action Form

Mark Buelsing 0 0 Article rating: No rating

Hello Mark,
 

You can either use the server request action and simply call the API using that or, depending on your DNNApi version there is a second action called Execute Api Method which skips the HTTP protocol and executes the method directly.

Kind regards,
Cristian P.

RSS
123