Hello,
I was developing a Drupal site that is heavily based on Panels, and getting webforms inside Panel panes is pretty neat! even Ajax.module is amazing for submitting webforms inside panels!
Anyway, I used the ajax_disable_redirect.module plugin to control webform redirection and keep my users where they are after submitting webforms. But the problem was: there was no meaning in disabling redirect, and removing the webform after successful submission, so users will get confused of what has just happened!
Therefore, I patched ajax_disable_redirect.module to get the "message that you specify in webform node" after successful webform submission; via ajax.
Please review the patch here, I guess it needs a lot of modifications. But this functionality is a must!
| Comment | File | Size | Author |
|---|---|---|---|
| disable_redirect.patch | 1.99 KB | mohammed j. razem |
Comments
Comment #1
imclean commentedWorks well in a block with Webform Block, cheers! Needed to theme the confirmation message to remove "go back to form" link.
Another issue and module entirely, but it might be nice if that link was an option in module settings rather than part of the theme.
Edit: I have 2 forms in blocks on the one page (one a search block). Upon submission of one form, the confirmation message replaces both forms. I have only enabled ajax and disable_redirect on the one form.
Comment #2
mikgreen commentedPatch works great! Thanks.
This should be in the module.
Comment #3
slavasilchenko commentedComment #4
chrisfree commentedI just tried this patch and didn't have any luck. I have a simple webform with two fields: Name (text) and Email (email field). After patching, the form submissions appear to not validate. The email field gets a red border in garland, yet no error messages are displayed. However, the submission emails still come through without issue. The confirmation message is never displayed.
Using the following versions of the modules:
Any ideas? Thanks!
Comment #5
drupal@guusvandewal.nl commentedThis is probably all wrong because I'm editing the file ajax_disable_redirect.js in the ajax module ... I needed to change the confirmation message in a modal screen. (colorbox).
Anyway, it works (not tested in all browsers)
Comment #6
jmaguniaI'm not sure if other people are experiencing this also, but after I applied both patches the login form would disappear also along with the webform block.
I then removed the js portion of the patch and now everything seems to be working ok.
--Edit--
The patches are actually working well for me. I think I was having earlier problems because I had Boost enabled. Sorry for the misinformation.
Comment #7
CyberPunX commentedTo imclean (first post):
I had the same problem... just figured it out...
In ajax_disable_redirect.js after applying the patch, replace line 29
var form = $('form').attr('id', args['form_id']).html(result['content']);
with
args.local.form.html(result['content']);
Sorry, not so good with patch files and all that...
Comment #8
nvakenPost #7 seems to me like bad practice. Selecting $('form') would actually replace all the forms on the page... I would suggest to use the following:
Comment #9
nvakenI am sorry, my above code is completely wrong. Here's the corrected version:
Comment #10
brendoncrawford commentedDoes anybody have a revised patch file for this? I can apply it if one is provided.
Comment #11
brendoncrawford commented