Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

The tag has no usage guidance.

0
votes
1answer
8 views

LoadForm Popup - Uncaught TypeError: Cannot read property 'split' of undefined

In all of my custom extensions, when I use the loadForm function to load a form (generated with Civix) as a popup, I get the following error: Uncaught TypeError: Cannot read property 'split' of ...
0
votes
1answer
16 views

Settings Definition (How to Use On_Change?)

Settings definitions allows for a field "on_change". Can anyone explain how to use this? I would like to have it execute a function that I have defined in my extension when my quickform is saved. ...
0
votes
2answers
29 views

Adding and storing form fields

I figured out how to add form fields using the buildForm hook. I am adding a select element to a participant profile on an event registration form. Do the values from the added fields get saved when ...
2
votes
1answer
44 views

How do I upload files in a custom form?

civix generate:form creates a basic form with a buildQuickForm() and postProcess() demonstrating a select option. I want the form to upload a file and save it to a custom field. If I add: $this->...
1
vote
0answers
24 views

Pre-fill custom field value on advanced contact search form

I have a custom field that I want to be searched when a user chooses a custom quicksearch option. I have the autocomplete working with the custom quicksearch option, but I want the behavior of ...
2
votes
2answers
40 views

Adding validation: cannot use $this in formRule() of Form

I am using CiviCRM 4.7.22 with Drupal 7 on Windows. I have a basic question. In the formRule() function inside the MembershipRenewal.php containing Membership Renewal Form if I use $this as below $...
1
vote
3answers
57 views

Editing a label in “new individual” form

I want to edit a field called "source" in the new Individual form. I want to change the name of the field. where can I change it?
1
vote
1answer
14 views

Do I need to sanitize quickform inputs in a extension?

Hopefully this is a quick one. I'm creating a form in an extension. Regular QuickForm - nothing special. Do I need to sanitize the inputs before processing them? Or does Civi/QuickForm handle that?
1
vote
1answer
37 views

How to alter the options inside element of a civicrm new membership form?

function custom_changes_civicrm_buildForm($formName, &$form) { if ($formName == 'CRM_Member_Form_Membership'){ foreach($form->_elements as $key => $value){ if ($key == 4){ $...
3
votes
1answer
32 views

Help with QuickForm Image Upload

I have created a form and I am trying to get an image to upload. I have the following set: $this->add( 'file', // field type 'image_file', // field name 'Upload Image', // field ...
2
votes
1answer
55 views

How to raise a form error in \CRM_Core_Form::postProcess()

I have a class with a signature: class CRM_Contact_Form_Task_FooPdf extends CRM_Contact_Form_Task { What generates a PDF. During the PDF generation, there might be an error. This task also uses the ...
1
vote
1answer
68 views

Dynamically Change QuickForm on EntityRef selection

I am building a form that has an entityRef that gets me a list of groups. When a group is selected I want another entityRef to be displayed that uses the value of from the entityRef selection (I'm ...
1
vote
1answer
105 views

Quickform: Set the “Selected” value in a select element

Maybe is a simple question but, in my form, I not able to set the "selected" value, in my SELECT element: The following is my code: CRM_Financial_BAO_FinancialType::getAvailableFinancialTypes($...
0
votes
1answer
135 views

CRM_Utils_Array::value how to set value to a hook_buildForm?

There is a https://wiki.civicrm.org/confluence/display/CRMDOC/hook_civicrm_buildForm manual page, but not sure I've got it right. Say, there is a value in a custom function, which should be set as ...
3
votes
1answer
65 views

How do I find the contact ID on a checksum link, after a form is submitted?

I'm trying to make an extension that does the following: User clicks link in email Form loads, extracts the contact ID from the querystring (along with a checksum for security), and customises the ...
1
vote
2answers
44 views

Why are my QuickForm checkboxes always ticked, in postProcess()?

I'm trying to build a form using QuickForm checkboxes. Here's what should happen: The form displays a bunch of checkboxes. These are ticked or unticked according to a load of API calls in ...