Page 1 of 1

Inputselect get style for marking all items.

Posted: 28 Oct 2021 00:55
by eil
More than in half of situations when i use Inputselect, it's not for selecting some among many results, but for excluding some among all. So each time i have to do all this "add + to get items pre-marked" cycle. Quite bothersome!
Can Imputselect please get some parameter for preselecting all items from the start?

Re: Inputselect get style for marking all items.

Posted: 22 Nov 2021 11:59
by eil
May it happen?

Re: Inputselect get style for marking all items.

Posted: 27 Dec 2022 13:01
by eil
So may Inputselect() get "pre-select all" parameter? I'd propose "Pre-select only one" parameter to be improved.

Re: Inputselect get style for marking all items.

Posted: 27 Dec 2022 14:34
by LittleBiG
I am just wondering why you didn't do it already by yourself... Like this, very roughly:

Code: Select all

//my inputselect to select all
 function inputselect2($list, $separator) {
   return inputselect(,"+".replace($list,$separator,$separator."+"),$separator,2);
 }
 echo inputselect2("a|b|c|d","|");

Re: Inputselect get style for marking all items.

Posted: 27 Dec 2022 16:17
by eil
My wish is exactly about not having to add this transformation codes each time, especially as Inputselect() function already has pre-select option, but for some reason only for 1 item.(never actually had a situation when i needed one pre-selected, only all or none)
Probably i can say that this strange-single-pre-select is my trigger, it exists while more useful option doesn't.

Re: Inputselect get style for marking all items.

Posted: 02 Jan 2023 09:09
by admin
Just logically reverse the results (treat checked as unchecked).

* * *

Whatever, I added it.

Re: Inputselect get style for marking all items.

Posted: 02 Jan 2023 19:02
by eil
Thank you!