BuddyDev

Search

Buddypress extended profile – how to add selection limit to multiselect box?

  • Participant
    Level: Enlightened
    Posts: 29
    Kreatsya on #15600

    Hello there!

    I’d like to add a multiselect box to the registration form with 70 options but limit the selection to 3. Is there a way to do it? It doesn’t have to be a multiselect box per se, it can be a drop-down menu or anything like that that will support choosing up to 3 options out of many (70, in my case0.

    Thanks in advance!

  • Keymaster
    (BuddyDev Team)
    Posts: 24706
    Brajesh Singh on #15602

    Hi Kr

    Welcome to BuddyDev. The mutli select box is a normal html multi select box. You can use some js code to restrict here.

    here is a link that should be helpful.

    https://stackoverflow.com/questions/2046205/how-do-you-limit-options-selected-in-a-html-select-box

    Also, if you have enabled select 2 on the field, we could use maximumSelectionLength: 3 in the field initializer. It’s not possible out of the box currently. You might have to modify the field type code for it.

    Regards
    Brajesh

  • Participant
    Level: Enlightened
    Posts: 44
    teacherpete on #40768

    Hi Brajesh,

    I would also like to limit the selection to fewer than 10 or 20 choices. But I’m so confused about the process. The Stack Overflow link above is very confusing to follow.

    Please could you explain the steps to limit a Multi-Select or Checkbox to a specified number of clicks? Or even better, would you be able to try and integrate this into the plugin so that we can limit the number of characters/selections/choices etc. within the plugin itself? That would be incredible! It would help so many people!

    Thanks for your support, and looking forward to hearing from you. 😁🙌

    Peter

You must be logged in to reply to this topic.

This topic is: not resolved