Jump to content

Dropdown select multiple


haitlaoussine

Recommended Posts

Nope.

Quote

Supported field types are “text”, “password”, “yesno” (checkboxes), “textarea”, “dropdown” and “radio”

IMO don't even start using _config() function. As you can see it is already limited and with time your addon could become so big and complex that you'll need to find alternatives. Moreover it doesn't support conditional options (e.g. Select A show B hide C).

Create a dedicated table (e.g. blabla_config) where you can store anything you need freely. This way you can create a dedicated page/interface if to configure your addon with text, password, multiselect, toggle, file uploader (...) inputs.

Edited by Kian
Link to comment
Share on other sites

I agree with Kian, but:

1 hour ago, Kian said:

Moreover it doesn't support conditional options (e.g. Select A show B hide C).

This is technically possible by checking which option was saved. Of course, the condition is only processed when the option was saved, so it is probably a bit cumbersome for the end user.
If you are a hardliner, you could use javascript to modify the output, but this is overkill. A configuration page inside yourmodule_output is the easiest way.

Link to comment
Share on other sites

11 hours ago, string said:

Of course, the condition is only processed when the option was saved, so it is probably a bit cumbersome for the end user

Yeah, it's impractical 😔 anyway I was thinking about a more complex scenario. For example think about Country/Region dropdown combo. Select Italy and get Italian regions, select Germany and get German ones, select Morocco and instead of a dropdown with regions you have a text field. Not to mention you can end up with things like Germany + Italian region stored in database 😭

Link to comment
Share on other sites

  • 4 years later...
On 1/13/2020 at 9:11 PM, haitlaoussine said:

Hello, 

I'm developing a plugin forWHMCS,  I need to know if there is a way to have a dropdown with select multi in WHMCS ?

I have set the 'Type' => 'dropdown', and the 'Multiple' => true, and the frontend is good, but is doesn't save the values in the database

Thank's

I've come across the same problem of multi-select but do not know how to do it, if the plugin is developed and live could you provide the url of it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated