Menu

Solutions to Problems or Custom Needs in a Website

Many solutions we create for one site can be used and appreciated on other sites also.

Have a look at this list of components and solutions we have developed over time and if you could benefit from any of them you are welcome to them.

Please let us know if you would like to discuss the details or would like some help getting one installed.

Push a Grid Selection to a Form

Mark Buelsing 0 2606 Article rating: No rating

You can pop up a grid that will display records to choose from and then take the values from the chosen row and put them into the fiels on the form. This is a multiple column drop-down list box.

(Something that I have asked for in the past)

Use the following JS to move the field data from the grid to the form

/* Insert the module id of your FORM in the line below */

var module = '#dnn458root';

 

/* Use your form field names on the left side, and values from your grid row on the right */

angular.element($(module)).scope().form.fields.FirstName.value = '[FirstName]';

angular.element($(module)).scope().form.fields.LastName.value = '[LastName]';

angular.element($(module)).scope().form.fields.Email.value = '[Email]';

/* Trigger the form to update by applying the field changes */

angular.element($(module)).scope().$apply();

See a nice video that demonstrates building the popup components here: https://www.youtube.com/watch?v=hw_zY1Vdp14&list=PL67RlTAxc73HwiL13W1nvYZ_Wgb2jhWwd&index=4

 

Remove the ActionGrid URL Parameters

Mark Buelsing 0 0 Article rating: No rating

ActionGrid adds parameters to the URL for Page settings even when paging is turned off and not needed. I like those parameters to not be in the URL. This script can be used to clean up the URL. Be careful though, this removes all URL parameters, so if there are parameters needed for something else on the page, don't use this.

 

setTimeout(function (){ history.pushState(null, null, 'dashboard');}, 5000);

You can put the script in the ActionGrid module settings, Advanced UI Settings, On Init Javascript

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 2557 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 Click a Button Using Javascript in Action Form

Mark Buelsing 0 0 Article rating: No rating

If the Button ID is FillDirectInput,

Use the following syntax to get the ID and insert into a JQuery click command

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

A way to get the form field values from an action form

${{form.fields.BodyType.value}}

form.fields.CarsName.value
form.fields.cbYear.selected.text

RSS
1234
RSS
1234