diff --git a/booking.emails_admin.inc b/booking.emails_admin.inc index ec4d8d4..440423f 100644 --- a/booking.emails_admin.inc +++ b/booking.emails_admin.inc @@ -339,7 +339,7 @@ function booking_manual_email_form($form, &$form_state, $input_option = "") $form['booking-email-default-ids'] = array ( '#type' => 'hidden', - '#value' => "", + '#value' => "[]", '#prefix' => '
Manual Email ajax html\n@info", array('@info' => print_r( $output_html, true))); return array( '#type' => 'ajax', '#commands' => array( - ajax_command_replace("#booking_email_default_ids_wrapper", render($replacementform_data['booking-email-default-ids'])), + ajax_command_replace("#booking_email_default_ids_wrapper", $output_html)), array('command' => 'bookingEmailIDs'), // This will call the command nameOfCommand we just created in the JS file. ) ); diff --git a/booking.js b/booking.js index 228ccc8..0173242 100644 --- a/booking.js +++ b/booking.js @@ -2,5 +2,6 @@ * Special Effects AJAX framework command. */ Drupal.ajax.prototype.commands.bookingEmailIDs = function(ajax, response, status) { - alert("Hello I'm Maged Eladawy...") ; // this will be executed after the ajax call + var initValues = $.parseJSON($('input:hidden#booking_email_default_ids').val()); + alert(initValues.first()) ; // this will be executed after the ajax call } \ No newline at end of file