Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I tried to make a paypal form as a subform:
$form['paypal'] = array(
'#type' => 'subform',
'#subform_id' => 'subform_paypal',
);
And the subform callback:
function subform_paypal($form, &$form_state) {
$form['#action'] = url('https://www.sandbox.paypal.com/cgi-bin/webscr');
$form['business'] = array(
'#type' => 'hidden',
'#value' => 'myemail@mycompany.com',
);
...
$form['actions'] = array('#type' => 'actions');
$form['actions']['submit'] = array(
'#type' => 'submit',
'#value' => 'Buy Now',
);
return $form;
}
When I click the 'Buy Now' button, the subform does not process to external url. Can someone please help? Thank you.
Comments
Comment #2
tjerah CreditAttribution: tjerah commented