Skip to content

Latest commit

 

History

History

object_select_multiple_without_ctrl_key

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Select Object: Select multiple items without holding the Ctrl Key?

In order to select multiple items in a select object, you must Ctrl-Click items to add them. If you forget to hold down the Ctrl key when clicking an item, all the previously selected items are lost.

To prevent accidentally clearing your selections, use the JavaScript below. It allows you to select items without holding the Ctrl Key.

☛ Add the following JavaScript Code to your form’s Custom Code field.

How to add Custom Code

function nuSelectMultiWithoutCtrl(i) {

	i = i === undefined ? 'select' : '#' + i;
	$(i + "[multiple] option").mousedown(function(event) {

		if (event.shiftKey) return;
		event.preventDefault();
		this.focus();
		var scroll = this.scrollTop;
		event.target.selected = !event.target.selected;
		this.scrollTop = scroll;
		$(this).parent().change();

	});

}

if (nuFormType() == 'edit') {
   nuSelectMultiWithoutCtrl()
}