Drupal 6.15

Ajax 6.x-1.x-dev
Ajax plugin - disable_redirect
Ajax plugin - scroller
Ajax plugin - webform
Ajax ui

Ajax settings:
Content Type: Webform Enabled | Disable Redirect | Remove Form After Submit
Content Type: Page Enabled | Disable Redirect | Remove Form After Submit
Webform: Contact Us Enabled | Disable Redirect | Remove Form After Submit

When I submit a form the confirmation message is place above the form but the form remains on the page. I can't figure out how to get the message to "replace" the form and the form come back on a refresh.

Thanks,
Jim

Comments

jsenich’s picture

Same thing happens for me. Did you find a solution for this Jim?

RobW’s picture

The webform block disappears for me, as expected with Remove Form After Submit, but I would be interested in knowing how to make it reappear on refresh / revisit. Edit: It was working but now it's stopped, I think when I moved from 1.14 to dev branch. I need some of the features in dev though, so no turning back.

Either of you find a solution or workaround?

burgs’s picture

I'm not getting this to work, even with 6.14. No javascript is taking over my webform, and it's submitting the form to end up returning:

{ "status": true, "updaters": [ ], "debug": [ ], "messages_error": [ ], "messages_status": [ { "id": 0, "value": "well done. we will contact you shortly." } ], "messages_warning": [ ], "redirect": null, "preview": null, "form_id": "webform_client_form_9673", "options": { "enabled": true, "disable_redirect": true, "remove_form": true, "scroller": true } }

Any ideas?

tko’s picture

I cant get any ajax to apply to my already made webforms! Content-type webform does work though so node/add/webform works. Frustrating

nlambert’s picture

Hi,

I've been trying to make this work for the contact form. I've enable the ajax, ajax ui, redirect and scroller modules and added the following to my settings module :

function SETTINGS_MODULE_form_contact_mail_page_alter(&$form, $form_state) {
$form['#ajax'] = array(
'enabled' => TRUE,
'disable_redirect' => TRUE,
'remove_form' => TRUE,
'scroller' => TRUE
);

The correct response seems to be returned :

{ "status": true, "updaters": [ ], "debug": [ ], "messages_error": [ ], "messages_status": [ { "id": 0, "value": "Your message has been sent." } ], "messages_warning": [ ], "redirect": null, "preview": null, "form_id": "contact_mail_page", "options": { "enabled": true, "disable_redirect": true, "remove_form": true, "scroller": true } }

... but the form unfortunately remains after submission.

I initially tried this with v.1.14 which wasn't working, so I moved to the dev version with no greater success.

I hope to find a solution.

Best regards

nlambert’s picture

Interesting...

The three following settings return the same result.

$form['#ajax'] = array(
'enabled' => TRUE,
'disable_redirect' => TRUE,
'remove_form' => TRUE
);

$form['#ajax'] = array(
'enabled' => TRUE,
'disable_redirect' => FALSE,
'remove_form' => FALSE
);

$form['#ajax'] = array(
'enabled' => TRUE
);

The ajax form is validated, message returned, no redirect.

However, I also tested this functionality using the login form and the Ajax UI. This does work perfectly well, but I'm stumped for the contact form.

Regards