?
Solved

drupal ajax web form

Posted on 2010-08-18
7
Medium Priority
?
759 Views
Last Modified: 2012-05-10
i have web form and web form block modules installed

how do i apply ajax to the form?
0
Comment
Question by:charmingduck
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33472168
This module can do it, http://drupal.org/project/ajax. Never used it before though.
0
 

Author Comment

by:charmingduck
ID: 33472210
i tried it with web form and web form block, didnt work, any ideas?
0
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33472322
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
Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

 

Author Comment

by:charmingduck
ID: 33472345
I used the ajax module and it broke my site,,,

but after i disabled it, everything's back to normal...
0
 
LVL 17

Accepted Solution

by:
Thomas4019 earned 2000 total points
ID: 33472372
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
 

Author Comment

by:charmingduck
ID: 33472384
any difference between uninstall a module and simply uncheck it?
0
 
LVL 17

Expert Comment

by:Thomas4019
ID: 33477528
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

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is for those that are having major problems with users upload files such as pictures to their profile. The solution is simple and has to do with correcting the directory paths. With some experimenting and testing i got it fixed. Note…
RTL (right to left) web applications aiming for audiences speaking languages like Hebrew or Arabic, are generally more complicated than the same applications aiming for audiences speaking Latin based languages. The main difference lies of course …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses
Course of the Month13 days, 7 hours left to enroll

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question