I have a page that has a form and uses the ajax submit handler. Can I use this module to handle the ajax submission through js.php??
function ajax_form() {
return array(
'email' => array(
'#type' => 'textfield',
'#title' => t('Join our Newsletter'),
'#required' => TRUE,
'#attributes' => array(
'placeholder' => t('mail@example.com'),
),
),
'submit' => array(
'#type' => 'submit',
'#value' => t('Subscribe'),
'#ajax' => array(
'callback' => 'demo_form_ajax_submit',
'wrapper' => 'demo-demo-form',
'method' => 'replace',
'effect' => 'fade',
'event' => 'click'
),
),
);
}
Comments
Comment #1
prabeen.giri commentedComment #2
prabeen.giri commentedI have to answer my own question.
Looks like its possible to have form ajax submit submitting to the js.php created by the js module.
We have to specify the ['path'] attribute on ajax parameters.
Implements hook_js().
Comment #3
prabeen.giri commented