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.

Set the Value of a Dropdown with JQuery

Mark Buelsing 0 0 Article rating: No rating

To set the value of a Action Form dropdown using JQuery

 

If you place your code in the On Change/Click section of a form field, the following will work:

form.fields.FieldName.value = "AValue";

*Note the value you are setting must match one of the choices in the dropdown

 

If you are placing your code in a static text field or the initilization section,

you might need to get in-scope to set it. Try the following example

 

//gets the scope and uses it to set the value

  angular.element($("#dnn931Size")).scope().form.fields.Size.value = '12px';

 

//Update the UI with the change
  angular.element($("#dnn931Size")).scope().$apply();

 

Pop Up a Page, or a Page with a Form on it

Mark Buelsing 0 3247 Article rating: No rating

If you want to pop up a page on top of the current one, add the following to the end of the querystring to remove the page skin and containers.

?dnnprintmode=true&SkinSrc=%5bG%5dSkins%2f_default%2fNo+Skin&
ContainerSrc=%5bG%5dContainers%2f_default%2fNo+Container

 

If this is a form, add the following to have the form close when it is submitted.

&afcallparentonsubmit=angridEditDone

See if a Particular Option has been Checked

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

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

Collapse the row with hidden fields

Mark Buelsing 0 2626 Article rating: No rating

Setting fields to Display:none hides them but the row that they are in still takes up vertical space. When you want to collapse that space, add the following

Add this class to the hidden field: HideFormGroup

Add this bit of JS somewhere in the form:  $('.form-group-HideFormGroup').parent().css("display","none");

 

RSS
1234567
RSS
1234