Over a million developers have joined DZone.

CiviCRM drop-down selector for payment_instrument field of form

// Drop-down selector for payment type (credit card, check, etc) - add this to preProcess() function of the controller code
$this->add('select', 'payment_instrument_id', 
                  ts( 'Payment method' ), 
                  array(''=>ts( '- select -' )) + CRM_Contribute_PseudoConstant::paymentInstrument( ),
                  false, array( 'onChange' => "alert('Add an onchange when a selection is made - perhaps using the built-in showHideByValue?');"));

// Show drop-down selector -- add this SMARTY code to the template code

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}