inputselect - preselect one item without using checkboxes

Features wanted...
Post Reply
highend
Posts: 14535
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

inputselect - preselect one item without using checkboxes

Post by highend »

Can you add a small tweak, please?

inputselect()
allows us to preselect item(s) by putting a "+" in front of it's item name (with style = 2).

It would be great if we could do the same without using checkboxes.
The first found item is used (if more than one item is found that uses a "+" in front of it)...

This shouldn't break existing scripts
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4387
Joined: 28 Feb 2012 19:27
Location: Windows 11, 24H2 Build 26100.4770 at 100% 2560x1440

Re: inputselect - preselect one item without using checkboxe

Post by klownboy »

I'd like that one too. When the script calls for only one item being selected and you are using checkboxes, if you want to change the preselected/pre-checked item, the user must unselect the checked one and reselect another one. So when not using checkboxes, it would be better if the script has one item preselected, but the user wants to select a different item, simply clicking on the other item would be enough to select it and when that happens the original item selected would be automatically unselected.

admin
Site Admin
Posts: 64668
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: inputselect - preselect one item without using checkboxe

Post by admin »

highend wrote:This shouldn't break existing scripts
I think it would break scripts where captions begin with a "+".

But I have found another solution.

highend
Posts: 14535
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: inputselect - preselect one item without using checkboxe

Post by highend »

I think it would break scripts where captions begin with a "+".
You're right. I was only thinking about files + folders, not about arbitrary data that could use a leading "+"...
One of my scripts helped you out? Please donate via Paypal

klownboy
Posts: 4387
Joined: 28 Feb 2012 19:27
Location: Windows 11, 24H2 Build 26100.4770 at 100% 2560x1440

Re: inputselect - preselect one item without using checkboxe

Post by klownboy »

Thanks Don for granting wish and highend for asking. :tup:

Post Reply