(Tips) Drupal Ajax with JQuery
Tips : Drupal Ajax with JQuery
Drupal is a fantastic CMS which I have been actively developing for, for some time now. Yesterday was the first time I had really ventured into the Ajax territory but I learnt a lot and hopefully this guide should help others.
Currently this example is Drupal 5.x only. I will update it for Drupal 6 in another post in due course.
I'm going to create a simple module to demonstrate the communication between client and server. There is already a module out there that does more or less exactly what this demo will do so I'd advise using that if you require the same functionality.
The demo module will be a simple username checker for new registrants. We will add a button to the registration form which will query the server for an existing user of that name. If it already exists we put up a warning otherwise we display a confirmation that they can safely use that name.
So, to begin, we will need the .info file which looks something like this:
; $Id$
name = Jquery Example
core = "5.x"
description = Quick example JQuery module. Adds a name checker to the register page.
version = "5.x-1.00"
Okay so now we want to create the .module file. We need 3 things: we need to hook into the registration page, a menu callback for our jquery and a function for it to call.
| Read more..
Courtesy : Joltbox.co.uk
- 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)