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
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.
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
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 4 years, 3 months ago by Mahaprabhu.
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.