Link to home
Start Free TrialLog in
Avatar of charmingduck
charmingduck

asked on

drupal ajax web form

i have web form and web form block modules installed

how do i apply ajax to the form?
Avatar of Thomas4019
Thomas4019
Flag of United States of America image

This module can do it, http://drupal.org/project/ajax. Never used it before though.
Avatar of charmingduck
charmingduck

ASKER

i tried it with web form and web form block, didnt work, any ideas?
Look at this page, http://www.lullabot.com/articles/modifying-forms-drupal-5-and-6,  under "Find the form ID". You'll need to find the id of your webform block form.

Then put the following code snippet in your theme's template.tpl.php (sounds familiar?). Replace THEMENAME, and YOUR-FORM-ID with your values.
THEMENAME_form_alter(&$form, $form_state, $form_id) {
  if($form_id == 'YOUR-FORM-ID') {
    $form['#ajax'] = array(
      'enabled' => TRUE
    );
  }
}

Open in new window

I used the ajax module and it broke my site,,,

but after i disabled it, everything's back to normal...
ASKER CERTIFIED SOLUTION
Avatar of Thomas4019
Thomas4019
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
any difference between uninstall a module and simply uncheck it?
Yes, unchecking disables the module, uninstalling removes all data related to that module. So that way when you enable it again you get a fresh start. Some modules can't be uninstalled because they don't create any data to remove.