CiviCRM drop-down selector for payment_instrument field of form
Join the DZone community and get the full member experience.
Join For Free// 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
{$form.payment_instrument_selection.html}
Form (document)
Opinions expressed by DZone contributors are their own.
Comments