Hot answers tagged

6 votes
Accepted

How to select multiple values in select2 control by jquery?

Ok, I found the way. It's just passing an array of option values to 'val' argument: $('#my_select2').select2('val', ["value1", "value2", "value3"]);
user avatar
  • 536
5 votes
Accepted

Editing RelationshipSelector.tpl section of a UserDashboard

The section is generated using the datatable, and data is called using ajax method. You could use ajaxsuccess to call after the data is retrieved from ajax.
user avatar
4 votes

How can arrange custom fields so they are side by side?

The case custom fields are formatted as a series of one row tables. You could add some jQuery to move them around. For example: CRM.$(function($) { $('#Outcomes table:nth-of-type(3n+1)').each(...
user avatar
  • 11.2k
3 votes
Accepted

How can I refresh a custom data tab in the contact summary?

I think you can set something in postProcess hook to reload the tabs possibly below code but not sure, it does work for us when we update something in a form we update the contribution tab using below ...
user avatar
3 votes

Having Trouble With Paths

That first error, "SyntaxError: expected expression, got "<" suggests that something in WordPress - a poorly behaving theme or plugin - is injecting text on every page load. That'll screw up ...
user avatar
3 votes

How to trigger JQuery event when drop down select list is changed in CiviCRM?

You cannot always predict the id or name for custom field for an activity, it is either custom_385_14(incase of saved custom field for activity where 14 is id from custom value table) or custom_385_-1 ...
user avatar
2 votes

Disable Inline Editing of Fields in Profile Form

It looks like this was a bug in CiviCRM. I have written a fix and submitted a pull-request for review. Your testing and feedback can help expedite the review process to get it accepted into the ...
user avatar
  • 16.2k
2 votes
Accepted

Fetch Node data from drupal into CiviCRM

I wasn't able to figure this out so data is Fetched directly into CiviCRM. However, I ended up using Drupal EntityQuery and fetched the data into a webform then Used Javascript PopUp Feature and ...
user avatar
  • 521
2 votes

Fetch Node data from drupal into CiviCRM

On which forms do you wish to add the fields/logic? I feel like there are two questions here: 1) How to build an arbitrary list of options from a third-party source of data (Drupal) 2) How to set ...
user avatar
  • 3,161
2 votes
Accepted

Removing elements for non-admin users

Are they in the administrators group? Since then you might be able to do something like (untested): CRM.api3('GroupContact', 'get', { "contact_id": "user_contact_id", // use this exact string to ...
user avatar
  • 18.3k
2 votes
Accepted

Civicontribute radiobuttons without "none", where the "Other" contribution field deselects radiobuttons

This code worked for me: CRM.$(function($) { $('input[type=text]', '#priceset').on('keyup', function() { if ($(this).val()) { $('input[type=radio]:checked', '#priceset').prop('checked', ...
user avatar
  • 16.2k
2 votes
Accepted

How to show/hide Profile based on Price set Total on a Contribution page?

I would use calculateTotalFee() to check if total amount is > 0. CRM_Core_Resources::singleton()->addScript(" CRM.$(function($) { hideshowMainProfile(); $('#priceset [price]').bind('...
user avatar
2 votes

How can I refresh a custom data tab in the contact summary?

So to enhance on the answer from Pradeep, here is what I have done: function myextension_civicrm_postProcess($formName, &$form) { if ($form instanceof CRM_Contact_Form_Inline_Email) { $form-...
user avatar
1 vote
Accepted

CRM.loadForm into div without popup

In the end I use popup to copy content from it and put it to div and it works just fine. All javascript in form works. I use 2s timeout, because .on('crmFormSuccess', function(event, data) {}); did ...
user avatar
  • 53
1 vote

Query string state/province field

Alternative answer is a Civi extension that uses the buildForm hook to prepopulate the field. Here's some example code that does something very similar on a custom field: function ...
user avatar
1 vote

Query string state/province field

Since you have the jQuery tag, I assume you're open to a jQuery solution. This StackOverflow question covers pulling a variable from a URL argument. Then it's just a matter of identifying the CSS ...
user avatar
1 vote

How to prevent a form submission on a CiviCRM form with jquery?

I would add validator method via js which would stop the submit until the validator returns true CRM.$(function($) { $.validator.addMethod('concessionaryError', function(value, element) { let ...
user avatar
1 vote
Accepted

CSS problems on Contact Notes View modal dialog

Turns out it was a CSS conflict with the Woocommerce Event Manager plugin in WordPress. In fact it was affecting the formatting of many different modal dialog windows in CiviCRM, not just the Contact ...
user avatar
  • 1,222
1 vote

jquery datepicker missing (wordpress) after updating to 5.26 from 4.6.33?

Never mind - all working now. I modified the CiviCRM Resource URL from the default that was in there of [civicrm.root] to be the full URL http://example.com/wp-content/plugins/civicrm/civicrm and the ...
user avatar
1 vote

How to show a CSS class of a contribution form based on Stripe iFrame element via jquery?

You can use the Stripe element events to trigger something - see https://stripe.com/docs/js/element/events We do that in the Stripe extension here: https://lab.civicrm.org/extensions/stripe/-/blob/...
user avatar
1 vote

Is it possible send a gif image correctly without breaking it?

The issue is with the intervention library used, which doesn't support animated GIFs. The intervention bug is 5+ years old. While intervention is open source, the maintainer is mostly inactive, and ...
user avatar
1 vote

Is it possible send a gif image correctly without breaking it?

Did you find an answer to your question? It seems that the platform does not accept the .gif format. Admin support and I figured it out... kinda: It works if you use the "traditional" email. The ...
user avatar
1 vote

How to select multiple values in select2 control by jquery?

you can also do it this way by defining javascript array. var Values = new Array(); Values.push("value1"); Values.push("value2"); Values.push("value3"); $("#my_select2").val(Values).trigger('change')...
user avatar
1 vote
Accepted

Nothing happens on selection of “Actions” dropdown options

Can you try below patch on shoreditch extension to see if it fixes your problem? diff --git a/js/main-menu.js b/js/main-menu.js index c4bd2576..c87ba81d 100644 --- a/js/main-menu.js +++ b/js/main-...
user avatar
1 vote

Civicontribute radiobuttons without "none", where the "Other" contribution field deselects radiobuttons

I have a contribution form layout similar to Coleman's that shows clickable amounts (pseudo-buttons) instead of visible radio buttons. It also has the "Other Amount" pseudo-button (see below). In ...
user avatar
  • 319
1 vote

alter/remove specific popup notifications

You are in the right path, if you look at the CRM_Core_Session class you'll see the method getStatus which takes a boolean as a parameter, if TRUEthen it will reset the status. That said, I would ...
user avatar
  • 2,301
1 vote

Haven't seen this in a while: jQuery is not defined on CiviMail 4.6.16

Hmm--in theory Drupal jQuery Update shouldn't make a difference. Ye olde jQuery in Drupal is the reason CiviCRM has its own CRM.$ or cj instead of regular $ or jQuery. Something must be using the ...
user avatar
  • 7,357
1 vote

Haven't seen this in a while: jQuery is not defined on CiviMail 4.6.16

What happens if you change themes to one of the basics? This looks somewhat similar in end result to the Backbone errors that are occurring with some of the themes. Do you see errors on the Manage ...
user avatar
  • 1,116
1 vote
Accepted

CKEDITOR is undefined when form is being loaded in model frame outside of /civicrm/ path

Since you are using 4.6, the answer is that you need to ensure templates/CRM/common/wysiwyg.tpl is being loaded and that the smarty variable $includeWysiwygEditor is set to true. Or since you are ...
user avatar
  • 16.2k

Only top scored, non community-wiki answers of a minimum length are eligible