Not come messages using AjaxForm in MODX Revo?

Welcome on the website two forms in one modal window on all pages, the second on the contact page in the page body, so the second form does not come to the message.

Modal form
<form class="form" method="post" action="[[~[[*id]]]]" data-smodx-productcls="callme" role="form">
<input class="form-control input-sm" type="hidden" name="nospam:blank" value="" />
<input class="form-control input-sm" type="hidden" name="work-email" value="" />
 <div class="form-group">
 <label>Name:<sup class="surely">*</sup></label>
 <input type="text" name="name" required="" class="form-control input-sm" placeholder="Your name*" value="[[+fi.name]]">
 <span class="error error_name">[[+fi.error.name]]</span>
</div>
 <div class="form-group">
 <label>Phone:<sup class="surely">*</sup></label>
 <input type="text" class="form-control input-sm" name="phone" required="" placeholder="Your phone*" value="[[+fi.phone]]">
 <span class="error error_name">[[+fi.error.phone]]</span>
</div>
 <div class="form-group dopolnitelno">
 <label for="dopolnitelno">More:<sup class="surely">*</sup></label>
 <div class="">
 <input type="text" class="form-control input-sm dopolnitelno" name="dopolnitelno" placeholder="Additional info" value="" />
</div>
</div>
the <div>
 <p><span style="float:left;font-size: 8px;">by submitting, you agree to the <a href="/confidense.html" nofollow="" target="_blank">privacy policy</a></span></p>
</div>
 <div class="modal-footer">
 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
 <input name="submit" name="form2" type="submit" class="btn btn-primary" onclick="yaCounter22063858.reachGoal('otpr_zak_zv');ga('send', 'event', 'otpr', 'obr_zvonok');return true;" value="Send">
 [[+fi.success:is=`1`:then=`<div class="alert alert-success">[[+fi.successMessage]]</div>`]]
 [[+fi.validation_error:is=`1`:then=`<div class="alert alert-error">[[+fi.validation_error_message]]</div>`]]
</div>
</form>


Email modal forms
the <h3>Message</h3>
 <p>From: [[+name]]</p>
 <p>Phone: [[+phone]]</p>


On the page
[[!AjaxForm?
&form=`tpl.modalfeedback`
&snippet=`FormIt`
&hooks=`FormitSaveForm,email,spam`
 &emailSubject=`call-Back`
&emailTo=`info@termal-shop.ru,kormilicyn_o@mehanika.ru,ivanov@mehanika.ru,kuznetsov@mehanika.ru`
&emailFrom=`info@termal-shop.ru`
&emailTpl=`tpl.modalfeedback.email`
&validate=`name:required:minLength=^3^,phone:required:minLength=^6^,dopolnitelno:blank,work-email:blank`
 &validationErrorMessage=`the form contains errors!`
 &successMessage=`Message successfully sent`
&redirectTo=`1`
 ]]


Form on the contact page
<form name="order_form" action="[[~[[*id]]]]" method="post" class="form form-horizontal" role="form" id="contact-form">
 <div class="panel panel-default">
 <div class="panel-heading">
 the <h3>write to us</h3>
</div>
 <div class="panel-body">
 <div class="control-group {if $form_result.field_errors.fullname}error{/if}">
 <label for="fullname">Name<span class="text-danger">*</span></label>
 <div class="">
 <input id="fullname" class="form-control" placeholder="what's your name?" type="text" value="[[!+fi.name]]" name="fullname">
</div>
</div>
 <div class="control-group {if $form_result.field_errors.email}error{/if}">
 <label for="email">Email<span class="text-danger">*</span></label>
 <div class="">
 <input id="email" class="form-control" placeholder="email Address" type="email" value="[[!+fi.email]]" name="email">
</div>
</div>
 <div class="control-group {if $form_result.field_errors.phone}error{/if}">
 <label for="telephone">Phone<span class="text-danger">*</span></label>
 <div class="">
 <input id="telephone" class="form-control" placeholder="telephone Number for connection" type="text" value="[[!+fi.phone]]" name="phone">
</div>
</div>
 <div class="control-group {if $form_result.field_errors.message}error{/if}">
 <label for="message">Comment</label>
 <div class="">
 <textarea rows="10" id="message" class="form-control" placeholder="Your question or suggestion" name="message">[[!+fi.text]]</textarea>
</div>
</div>
 <div class="control-group {if $form_result.field_errors.phone}error{/if} dopolnitelno">
 <label for="dopolnitelno">More<span class="text-danger">*</span></label>
 <div class="">
 <input type="text" class="dopolnitelno" name="dopolnitelno" value="" />
</div>
</div>
</div>
 <div class="panel-footer">
 <input type="submit" class="btn btn-warning" name="form1" value="Send" />
</div>
</div>
</form>


Email on the contact page
the <h3>Message</h3>
 <p>From: [[+fullname]]</p>
 <p>E-mail: [[+email]]</p>
 <p>Phone: [[+telephone]]</p>
 <p>Message: [[+message]]</p>


On the page
[[!AjaxForm?
&form=`tpl.feedback`
&hooks=`FormitSaveForm,email`
 &emailSubject=`Message from website "Termal Shop"`
&emailTo=`kuznetsov@mehanika.ru,info@termal-shop.ru,antoshin@termal-shop.ru,ivanov@mehanika.ru`
&emailFrom=`info@termal-shop.ru`
&emailTpl=`tpl.feedback.email`
&validate=`name:required,email:required,message:required,dopolnitelno:blank`
 &validationErrorMessage=`the form contains errors!`
 &successMessage=`Message successfully sent`
 ]]
March 12th 20 at 08:06
2 answers
March 12th 20 at 08:08
Hello, there was a bug once with a modal form script modal forms cut the entire form in the window and, accordingly, the class AjaxForm was out of shape and form did not work, maybe trouble in this.
You can detail paint? Form on the contact page is not in a modal window - rosanna commented on March 12th 20 at 08:11
@rosanna, I was wrong, I thought that it does not trigger the modal form.
And here you have the form in the Contacts there
&validate=`name:required,email:required,message:required,dopolnitelno:blank`

dopolnitelno must be empty for the call, and in the form of standing * can test when you fill out this field (and you need not fill in the blank)? - Wilbert commented on March 12th 20 at 08:14
@Wilbert, is a trap for spambots, it to css display:none; - rosanna commented on March 12th 20 at 08:17
@rosanna, I Realized, well if the error is not clear. Could the script Formit falls off on condition {if $form_result.field_errors.phone}error{/if}
Try testing both forms at the same time with minimal call AjaxForm.

p.s. Today I tested the 2 forms on the website, one is also in a modal window - both work, no problems. - Wilbert commented on March 12th 20 at 08:20
@Wilbert, say, and submitvar need to add? - rosanna commented on March 12th 20 at 08:23
@rosanna, No, I did not add - Wilbert commented on March 12th 20 at 08:26
@Wilbert, well, I have still not works - rosanna commented on March 12th 20 at 08:29
@Wilbert, updating information from the modal form comes with static, which is on the page, no - rosanna commented on March 12th 20 at 08:32
@rosanna, it is Not clear what the problem is, I have the latest MODX, all components are updated and php (or 5.6 or 7), here's my challenge 2 forms, see:
Contact form
<section class="feedback left">
 <div class="title">feedback</div>

[[!AjaxForm?
&snippet=`FormIt`
&form=`form_contacts_tpl`
&emailTpl=`form_contacts_send_tpl`
&hooks=`email,spam`
 &emailSubject=`[[++name]]: a message from the site`
 &emailFromName=`[[+contacts_name]] ([[+contacts_email]])`
&emailTo=`[[++email]]`
&emailFrom=`noreply@[[++site_url:stripString=`https://`:stripString=`http://`:stripString=`/`]]`
&validate=`contacts_theme required,
contacts_name required,
contacts_email:email:required,
contacts_message:required`
 &validationErrorMessage=`the form contains errors`
 &successMessage=`Message successfully sent`
&clearFieldsOnSuccess=`1`
]]
</section>

Chunk-form template contacts

<form action="[[~[[*id]]]]" enctype="multipart/form-data" method="post">
 <div class="line left">
 <input type="text" name="contacts_name" value="" class="input" placeholder="Your name *">
</div>

 <div class="line right">
 <input type="email" name="contacts_email" value="" class="input" placeholder="email *">
</div>
 <div class="clear"></div>

 <div class="line left">
 <input type="tel" name="contacts_phone" value="" class="input" placeholder="Phone">
</div>

 <div class="line right">
 <input type="text" name="contacts_company" value="" class="input" placeholder="Company">
</div>
 <div class="clear"></div>

 <div class="line">
 <textarea name="contacts_message" placeholder="Message *"></textarea>
</div>

 <div class="submit right">
 <button type="submit" class="submit_btn">Submit</button>
</div>
</form>

[[+fi.success:is=`1`:then=`
the <div>[[+fi.successMessage]]</div>
`]]

[[+fi.validation_error:is=`1`:then=`
the <div>[[+fi.validation_error_message]]</div>
`]]

---------
Modal form

<div class="modal_box">
 <div class="modal" id="order_form">
 <a href="#" class="close"></a>
 <div class="modal_title">Leave application</div>

[[!AjaxForm?
&snippet=`FormIt`
&form=`form_modal_tpl`
&emailTpl=`form_modal_send_tpl`
&hooks=`checkSpam,email,spam`
 &emailSubject=`[[++site_name]]: the Application site`
 &emailFromName=`[[+name]] ([[+contact]])`
&emailFrom=`noreply@[[++site_url:stripString=`https://`:stripString=`http://`:stripString=`/`]]`
&emailTo=`[[++email]]`
&validate=`name:required,
contact:required`
 &validationErrorMessage=`the form contains errors`
 &successMessage=`Message successfully sent`
&clearFieldsOnSuccess=`1`
]]
</div>
</div>

Chunk-pattern modal forms

<form action="[[~[[*id]]]]" method="post">
 <div class="line">
 <div class="name">Introduce yourself <span class="required">*</span></div>
 <input type="text" name="name" value="" class="input">
</div>

 <div class="line">
 <div class="name">your contact <span class="required">*</span></div>
 <input type="text" name="contact" value="" class="input">
</div>

 <div class="line">
 <div class="name">Tell us a little about your project</div>
 <textarea name="message"></textarea>
</div>

 <div class="submit">
 <button type="submit" class="submit_btn">Submit</button>
</div>
</form>

[[+fi.success:is=`1`:then=`
the <div>[[+fi.successMessage]]</div>
`]]

[[+fi.validation_error:is=`1`:then=`
the <div>[[+fi.validation_error_message]]</div>
`]]
- Wilbert commented on March 12th 20 at 08:35
@rosanna, I noticed another inaccuracy.
You have in the form is name="phone" and check [[!+fi.phone]], and is sent to the Phone: [[+telephone]] - Wilbert commented on March 12th 20 at 08:38
March 12th 20 at 08:10
&validate=`name:required,email:required,message:required,dopolnitelno:blank`

and on the page you have input id="fullname"

name validation should be changed to fullname

well telephone to add in validation

Find more questions by tags MODX