Hi all,
(FIrst I don't know if this is the right forum, sorry if it is not !).
I am using overlay module to display some nodes form.
I have a custom cancel button to close the overlay (with confirmation message before) and i am trying to use this function : Drupal.overlay.close(); which working well in firebug/chrome console bug never work at all in my Drupal code :((. I really don't understand !!
Here is a part of my code :
drupal_get_library('overlay');
drupal_add_library('overlay', 'parent');
drupal_add_library('system', 'ui.dialog');
drupal_add_library('system', 'ui.draggable');
//Cancel button on our forms
$form['actions']['cancel'] = array(
'#type' => 'button',
'#value' => t('Cancel'),
'#access' => TRUE,
'#weight' => 15,
'#limit_validation_errors' => array(),
'#attributes' => array(
'onclick' => 'cancelFunction(event);'
),
);
and in my js file i have thing like that:
cancelFunction = function (event){
Drupal.overlay.close();
...
No reaction when the code is executing ... !! No errors from firebug and if a put alert before, the alert is displayed ...
Any ideas ?