drupal ajax web form

i have web form and web form block modules installed

how do i apply ajax to the form?
charmingduckAsked:
Who is Participating?
 
Thomas4019Connect With a Mentor Commented:
hmmm, well the ajax module is the way to get this done. I would recommend uninstalling the module (at example.com/admin/build/modules/uninstall. And then re-enable the module. Then go to admin/settings/ajax and turn off ajax for every form. This way it shouldn't break your site. then you can follow my instructions above. If you run into problems googling "hook_form_alter" might help.
0
 
Thomas4019Commented:
This module can do it, http://drupal.org/project/ajax. Never used it before though.
0
 
charmingduckAuthor Commented:
i tried it with web form and web form block, didnt work, any ideas?
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
Thomas4019Commented:
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

0
 
charmingduckAuthor Commented:
I used the ajax module and it broke my site,,,

but after i disabled it, everything's back to normal...
0
 
charmingduckAuthor Commented:
any difference between uninstall a module and simply uncheck it?
0
 
Thomas4019Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.