(Tutorial) The Key To Jquery Form Plugin + Drupal Formapi
Tutorial : The Key To Jquery Form Plugin + Drupal Formapi
-
Today I bring you an incomplete, yet stunningly easy solution to a problem that's been making want to set buildings on fire.
This problem was making drupal comments go AJAX by way of jquery's form plugin. I had all the good makings of a digg clone comment system, with reply forms dynamically inserting under replies (instead of going to another page). It was just the sans-pagerefresh comment submit thing that was missing.
Tragically, breaking the submit (necessary for ajax) also broke the ability for formapi to do its magic. Then, MerlinofChaos pointed out the 'obvious'approach on IRC.
Use drupal_execute to emulate form submission at a custom callback url. This approach can be applied to any form, so far as I can imagine. So I'm sharing it before I complete the much needed, and long desired ajax_comments.module (yes, it is really coming... solving this problem means I jumped over the last hurdle).
Courtesy : nicklewis.org
- guru's blog
- Login to post comments
![Drupal-6-Book-[Building Powerful and Robust Websites with Drupal 6].jpg](http://www.drupalranch.com/images/Drupal-6-Book-[Building%20Powerful%20and%20Robust%20Websites%20with%20Drupal%206].jpg)