Hi,
I am using #ajax to submit a simple one textarea data. however i need to call a popup when user click on submit button to ask whether they like to recieve email or not.
I can do this by using simple ajax beforeSend event in jquery. But like to know how i can call beforeSend event in form api on clicking submit button. Below is my code for submit button calling ajax submit.

$form['submit'] = array(
'#type' => 'submit',
'#value' => 'Save',
'#title' => t('Save'),
'#attributes' => array('class'=>array('imp_submit')),
'#prefix'=>'

',
'#suffix'=>'

',
'#ajax' => array(
'callback' => 'my_js_function',
'wrapper' => 'import_message',
'progress' => array('type' => 'bar'),
'event'=>'click',
),
);

Now where and how to add beforeSend call ?
here is a reference what i want to do if using direct jquery code :
$.ajax({
beforeSend: function(){
// Call Popup
},
complete: function(){
// submit the form
}
// ......
});
Please help me on this.

Comments

cweagans’s picture

Priority: Critical » Normal

Support requests are neither major nor critical.

bharat83’s picture

Status: Active » Closed (fixed)