Skip to main content

Questions tagged [select2]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
26 views

How can I implement a select-or-other widget over a plain text field?

I have a field which normally expects a value selected from a managed list (e.g. a list of courses, a list of colleges). The client would like the visitor to be prompted with one of the managed list ...
Alan Dixon's user avatar
  • 6,861
1 vote
1 answer
83 views

Issue with select2 widget

We're working on a french postal codes extension based on the Belgian one. We want to use the API provided by the National French Mail Company. According to the Select2 doc for Ajax (remote request), ...
Guillaume Sorel's user avatar
0 votes
1 answer
131 views

Select2 in php forms?

I have a simple quickform -- $this->add('text','trial_number','Trial Number',TRUE); $this->add('date','Trial_Date',ts('Trial Date'),CRM_Core_SelectValues::date(NULL, 'Y M d',15,1) ); ...
Norm Dressler's user avatar
4 votes
1 answer
141 views

Drop down labels on front end CiviCRM forms not accessible (With solution!)

Front end CiviCRM (5.21 and older) forms have drop down select list labels which are not accessible. When using a screenreader such as jaws, the reader reads the selected value of the control instead ...
Neil Davis's user avatar
2 votes
0 answers
257 views

How do you select a value of an EntityRef Select2 using jQuery?

I have a scenario where a user selects a row of data to edit and I want an EntityRef Select2 box to be populated with a piece of information from that row. The EntityRef select2 widget works for ...
Alec Macleod's user avatar
0 votes
1 answer
57 views

Why doesn't anything happen when I select a search action from the CiviCRM search results?

I'm in CiviCRM 5.5.0 and everything works perfectly - except that nothing happens when I select a search action like "Add an activity". There are no errors in the Javascript console. What's ...
Jon G - Megaphone Tech's user avatar
1 vote
2 answers
893 views

How to listen to country select change

How can I listen in JavaScript to the event of a country value change on the country select field? both #select2-drop-mask and #select2-drop are not available until the user clicks to open the select....
Elad's user avatar
  • 621
2 votes
1 answer
2k views

How can I trigger a selection for a Select2 EntityRef element via javascript?

The CiviCRM EntityRef form element uses a Select2 select box to make lots of CiviCRM forms more awesome. A user can, for example, search for contacts to choose one. Great. I am building an extension ...
Sean's user avatar
  • 3,168
1 vote
0 answers
2k views

ngChange event fired twice when using multi-select with crmUiSelect

I'm trying to use CiviCRM's crmUiSelect AngularJS directive to create a select2 element in a form. I want to call a function in my controller when the user changes this element, so I'm using the ...
Sean's user avatar
  • 3,168
0 votes
1 answer
1k views

Multi-select not working with crmUiSelect AngularJS select2 directive

I created a select2 element with CiviCRM's crmUiSelect AngularJS directive by using the following code in my controller: $scope.options = [ {"value": "foo", "label": "Foo"}, {"value": "bar", "...
Sean's user avatar
  • 3,168
4 votes
2 answers
70k views

How to select multiple values in select2 control by jquery?

I want to select multiple options in a select2 multivalue control, when clicking a button. This is useful specially for searches where the user needs to select many option to one of the filters any ...
luciano_s's user avatar
  • 566
5 votes
2 answers
6k views

Setting Select2 widths

We have a number of forms that have items on them using the built in Select2 support. They aren't quite wide enough; annoyingly so. For the default selection, you can see the membership type and the ...
Rob Brandt's user avatar
3 votes
1 answer
586 views

How do you visually update a select2 widget?

I'm trying to select the value of a select2 widget using js. I can change the value ok: jQuery('#excludeGroups').val("846").trigger("change"); The problem I'm having is that this doesn't update the ...
Andrew West's user avatar
  • 2,044