Support » Plugin: BP Profile Search » How to make a Multi select box

  • Hi
    Thank you for the plugin. It is very useful. I want to have a Country Multi select box – where people can select one or Multiple countries – when searching – by typing or scrolling down.
    Right now – it shows as a long list of Checkboxes – it makes the form very long.
    Please guide on this
    Thank you very much

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Mahaprabhu

    (@mpcd108)

    Just to clarify – i have users who have in their profile selected from a Drop down select box – the country they live in.
    Now when I search – i want a Multi select box – to search for people form US or UK or Country1, Country2 etc.
    The checkbox is the default – and is cumbersome. Thank you very much

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi Mahaprabhu,

    You can add this code to your bp-custom.php file:

    add_action ('bps_field_before_search_form', 'change_display');
    function change_display ($f)
    {
    	if ($f->code == 'field_208' && $f->display == 'checkbox')
    	{
    		$f->display = 'multiselectbox';
    		$f->multiselect_size = 10;
    	}
    }

    Replace 208 with the actual field ID of your field, and 10 with the box size you prefer.

    Thread Starter Mahaprabhu

    (@mpcd108)

    Thank you very much – this worked for making the checkboxes into a multi select box –
    The issue of size is not working – for all my Search boxes – either single select or Multi select – i have the same issue.
    They start from a width of about 0.5 cm – and once i click something in them – then it expands sideways to the size of the word – say Chile is about 1 cm wide, but if i choose United States then about 3 cm – like that.
    Its hard – because the users cannot understand what is under the hood – so to say. Maybe i have not done some basic step – like add some script for Select 2 etc.

    Please guide. Thank you very much

    Thread Starter Mahaprabhu

    (@mpcd108)

    so approximately the size is as much as that of a Checkbox – here is an image to see it
    https://ibb.co/Tr2thvn

    Residing in – is the Country Multi Select box i just now made

    • This reply was modified 3 years, 8 months ago by Mahaprabhu.
    Plugin Author Andrea Tarantini

    (@dontdream)

    Hi Mahaprabhu,

    Which form template are you using? Please copy and paste the template name and description you can find in Users -> Profile Search, in the Template column.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to make a Multi select box’ is closed to new replies.