Hi all, I'm trying to include a form from a module trought a ajax callback on D7 [1]. Actually I got a button #ajax-ed which load the form in a wrapper on the page. The form is altered in callback to make it ajax enabled, specifing #ajax settings plus custom #submit & #validate callback. The form loads correctly, but, when submitting, it post the whole page to /system/ajax, on a blank page (or without ajax it post to the correct path but not triggering the custom #submit). I've tryed both drupal_get_form and drupal_build_form with custom form_state settings (eg. no_cache, rebuild) to skip/force rebuild of form (and cache). Thanks in advance, Luca [1] http://drupal.org/node/1218474#comment-4744608
Hi, Take a look at the examples project, there is a couple of examples on how to dis this in D7, they are actually quite elegant, and usually only require a very few lines of code to do it. http://drupal.org/project/examples I think it is example 8,9 that show this. Gordon. On 21/07/2011, at 4:31 PM, luca capra wrote:
Hi all, I'm trying to include a form from a module trought a ajax callback on D7 [1]. Actually I got a button #ajax-ed which load the form in a wrapper on the page.
The form is altered in callback to make it ajax enabled, specifing #ajax settings plus custom #submit & #validate callback. The form loads correctly, but, when submitting, it post the whole page to /system/ajax, on a blank page (or without ajax it post to the correct path but not triggering the custom #submit).
I've tryed both drupal_get_form and drupal_build_form with custom form_state settings (eg. no_cache, rebuild) to skip/force rebuild of form (and cache).
Thanks in advance, Luca
This is the wrong list for this question. This list is reserved for developing Drupal core. In the future please use support@drupal.org and please review http://drupal.org/support and http://drupal.org/community. Gordon Heydon wrote:
Hi,
Take a look at the examples project, there is a couple of examples on how to dis this in D7, they are actually quite elegant, and usually only require a very few lines of code to do it.
http://drupal.org/project/examples
I think it is example 8,9 that show this.
Gordon.
On 21/07/2011, at 4:31 PM, luca capra wrote:
Hi all, I'm trying to include a form from a module trought a ajax callback on D7 [1]. Actually I got a button #ajax-ed which load the form in a wrapper on the page.
-- Earnie -- http://progw.com -- http://www.for-my-kids.com
On 21/07/2011 20:16, Earnie Boyd wrote:
This is the wrong list for this question. This list is reserved for developing Drupal core. In the future please use support@drupal.org and please review http://drupal.org/support and http://drupal.org/community. Ok, I'm sorry. I'll move to the right list. Gordon Heydon wrote:
Hi,
Take a look at the examples project, there is a couple of examples on how to dis this in D7, they are actually quite elegant, and usually only require a very few lines of code to do it.
http://drupal.org/project/examples
I think it is example 8,9 that show this. Thank you, I read the examples but decided to move to something else like ctools dialog, because I was rendering a form inside a form and it's not really nice, I think :) Luca Gordon.
On 21/07/2011, at 4:31 PM, luca capra wrote:
Hi all, I'm trying to include a form from a module trought a ajax callback on D7 [1]. Actually I got a button #ajax-ed which load the form in a wrapper on the page.
participants (3)
-
Earnie Boyd -
Gordon Heydon -
luca capra