Difference between revisions of "Auto select single group membership type"

From UnionCloud Support
Jump to: navigation, search
(Page creation)
 
m (Orry Verducci moved page Auto select only membership to Auto select single group membership type: Clarify page title)
(No difference)

Revision as of 09:41, 16 December 2016

When a student joins a group, they have to select a membership type for the group. When there is only a single membership type for the group, the platform still requires the student to select it.

The following code snippet, which should be put in Global Javascript, will automatically select the membership type if there is only one membership type listed on the page.

$(function() {
    if (window.location.pathname.substring(window.location.pathname.length - 5) == '/join' || window.location.pathname.substring(window.location.pathname.length - 5) == 'join/') {
        if ($('.memberShipType').length == 1) {
        	$('.memberShipType').click();
        }
    }
});