The use of FormIt with AjaxForm mode

Hi there,
for the FormIt - used it on several projects and it’s cool.

But recently noticed that customers call reporting their submissions were left without a reply. When we check saved submits - no track by email / name / etc..
Probably a hosting issue or db or else…
I have to implement another storage but not sure what to select - just a file or a messaging broker like Kafka / rabbitMQ
Any advise ??

Step to reproduce

using XHR
{$_modx->runSnippet('!AjaxForm', [
'snippet'=>'FormIt',

Observed behavior

Once submitted they say they saw a green confirmation and got redirected to “Thank you“ page. But no track on the backend.

Expected behavior

We need to get email from submissions, get each submission saved to manager page → Extras → Formit → list of saved submissions

Environment

MODX 3.1, no matter apache or nginx - we live in several environments and notice the same behaviour (within the same hosting company but different metal)

What does your FormIt call look like? What version of FormIt?

OK, lets see:

What does your FormIt call look like?
{$_modx->runSnippet(‘!AjaxForm’, [
‘snippet’=>‘FormIt’,
‘formName’ => ‘cntc’,
‘validationErrorMessage’ => ‘The form contains errors’,
‘formSelector’ => ‘contact_us’,
‘formFields’ => ‘name,subject,email,message’,
‘fieldNames’ => ‘name==Name,email==Email,subject==Subject,message==Message’,
‘emailTo’=> ‘[email protected]’,
‘emailSubject’=>‘Contact from Web site’,
‘emailFrom’=> ‘[email protected]’,
‘emailFromName’=> ‘web site form’,
‘form’=>‘contact_form’,
‘emailTpl’=>‘contact_email’,
‘hooks’=>‘recaptchav3,email,FormItSaveForm’,
‘validate’=>‘name:required,email:required,workemail:blank’
])}

What version of FormIt?
Same method is used on a couple of websites:

  • MODX Revolution 2.8.6-pl / FormIt 4.2.7-pl / PHP 7.4 / MySQL MariaDB 10.11.x

- MODX Revolution 3.0.6-pl / FormIt 5.1.1-pl / PHP 8.2 / MySQL 8.4.x

Thanks.

Does the plain FormIt call work? Without AjaxForm, it’s clear that it’s not a FormIt problem. Are there any errors in the MODX log when the form is submitted? Try changing the order of the hooks so that the form is saved before it is submitted. You could also deactivate the reCAPTCHA hook for testing.

1 Like