2

I need to add a target attribute to the "form action" tag of an Event Registration form, because I need the Confirmation to open in a new window.

I'm trying to find the TPL file that inserts the "form action" tag, but I couldn't find it already. So, where is it?

Thanks.

2

Most / All forms inherit the form code from:

templates/CRM/Form/default.tpl

I dont think you should modify that. However, the form tag also emits all attributes attached to the form. So your best bet will be to add an attribute to the form object in the buildForm hook for event registration. There is a method call on the form object to add an attribute:

$form->updateAttributes()

lobo

| improve this answer | |
  • Thank you Lobo, it worked fine with this content in the civicrmHooks.php (posting here if anyone needs it): <?php /** * Inserts a call to a new browser screen/tab when submit event '1' registration form. */ function joomla_civicrm_buildForm($formName, &$form) { if ($formName == 'CRM_Event_Form_Registration_Register') { if ($form->_eventId == 1) { $form->updateAttributes(array('target' => _blank)); } } } – diegov Apr 15 '15 at 20:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.