Page 1 of 1

Select Multiple field - how to select all

Posted: Mon Apr 29, 2019 5:30 pm
by Janusz
I use the Select Multiple box - and in the default initial state all values are in the "not selected" status what is normal.
Is it possible by any command to select automatically all values (instead of clicking all of them) and the best to select only defined values except the first empty field.

Re: Select Multiple field - how to select all

Posted: Mon Apr 29, 2019 10:07 pm
by Janusz
in the mean time I found the solution:

FYI
the first line selects all elements and the second one deselects the first empty row

Code: Select all

$('#search_field_multi option').prop('selected', true);
$('#search_field_multi option:eq(0)').prop('selected', false);

Re: Select Multiple field - how to select all

Posted: Tue Apr 30, 2019 8:23 am
by kev1n
Or hit Ctrl+A to select all