If you are using Ajax module for Drupal Forms which having image button, then you can not submit the form.
To fix that kind of issue then we have to use '#button_type' => 'submit ajax-trigger', attribute to submit button. Below is the sample code...
$path = drupal_get_path('theme', 'tradenet').'/images/image_button.png';
$form['#ajax'] = array(
'enabled' => TRUE
);
$form['submit'] = array(
'#type' => 'image_button',
'#access' => 1,
'#button_type' => 'submit ajax-trigger',
'#src'=>$path,
'#ajax' => array('submitter' => TRUE ),
);
To fix that kind of issue then we have to use '#button_type' => 'submit ajax-trigger', attribute to submit button. Below is the sample code...
$path = drupal_get_path('theme', 'tradenet').'/images/image_button.png';
$form['#ajax'] = array(
'enabled' => TRUE
);
$form['submit'] = array(
'#type' => 'image_button',
'#access' => 1,
'#button_type' => 'submit ajax-trigger',
'#src'=>$path,
'#ajax' => array('submitter' => TRUE ),
);
Hey,
ReplyDeleteI'm having the exact problem right now. I tried your code but its not working for me - my ajax still doesn't return anything.
Are you sure your line
'#ajax' => array('submitter' => TRUE),
is correct ? I search for such in the doc but there is nothing about this (http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7)
Thanks
Hi, yeah this post is really pleasant and I have learned lot of things from it on the topic of blogging. thanks.
ReplyDelete