Hi,
I don't know how to create a Popup programatically.
I have a form and I need to create text with a link that popup some text.
I've tried to use the next code:

$form['my_text'] = array(
'#title' => 'My field',
'#type' => 'textfield',
'#description' => popup_filter_process_tag('[popup title="Help" text="This is just a text field"]')
);

but the next error is shown...
Fatal error: Call to undefined function popup_filter_process_tag() in ../sites/all/modules/form_contacto/form_contacto.module on line 103

Thanks,
Sandra

Comments

sethfreach’s picture

try using popup_filter_process_text()

sand_ru’s picture

The same error:
Fatal error: Call to undefined function popup_filter_process_text() in ../sites/all/modules/form_contacto/form_contacto.module on line 103

I have to install the module and use it in my module or I have to put some code in the module?

Thanks!

AlexanderPop’s picture

try (with latest build)

require_once drupal_get_path('module', 'popup') . '/includes/popup.api.inc';
$text = "<p>This is just a text field</p>";
$help = "<h4>Title Help text</h4>";

$form['my_text'] = array(
 '#title' => 'My field',
 '#type' => 'textfield',
 '#description' => popup(array('text' => $text, 'title' => $help))
 );
Scheepers de Bruin’s picture

Status: Active » Closed (works as designed)