[[+content_image]]
S
S
svetuk2018-08-17 12:44:56
MODX
svetuk, 2018-08-17 12:44:56

How to fix: MODX => AjaxForm + Formit gives error "No form key (action) specified"?

Hello, there is a problem (maybe someone faced):

[[!AjaxForm?
            &snippet=`FormIt`
            &form=`tpl.feedback_re`
            &validate=`contact_name:required,contact_type:required`
            &hooks=`email`
                &emailTpl=`feedback_mailtpl`
                &emailSubject=`Сообщение форма4`
                &emailTo=`@gmail.com`
                &emailFrom=`[email protected]`
                &submitVar=`form4`
                &validationErrorMessage=`В форме содержатся ошибки!`
                &successMessage=`Сообщение успешно отправлено`
            ]]

tpl.feedback_re
<form method="post" id="form4" action style="position: relative;">
      <div class="form-head">
        	<div class="validation-errors"></div>
        </div>
      <div class="form-wrap">
           <div class="form-group">
              <input name="contact_name" value="[[+fi.contact_name]]" type="text" class="zak sis55 form-control" pattern="[A-Za-zА-Яа-яЁё\s]{3,}" placeholder="Введите ваше имя" style="background: url(/assets/img/form/user.png) no-repeat 95% 12px;"/> 
          </div>
           <div class="form-group">
              <input name="contact_type" value="[[+fi.contact_type]]" type="text" class="zak sis56 form-control" placeholder="Введите телефон или e-mail" style="background: url(/assets/img/form/phone.png) no-repeat 95% 12px;"/> 
            </div>
                <div id='recaptcha1'></div>
          <input name="form4" type="submit" value="Отправить заявку" class="zak inp"/>
      </div>
      <span class="success"><p>Сообщение успешно отправлено!</p></span>
    </form>

The form works, messages are sent, but AjaxForm gives an error: "Form key (action) is not specified" PS recaptcha is connected in js
block , which does not help: 1 - write in action= 2 - change permissions on session.save_path <div id='recaptcha1'></div>

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
I
Ilya Gureshidze, 2018-08-17
@enigman90

Do you have a site with one context?
Check through the Chrome Inspector whether it is in the form
<input type="hidden" name="action" value="хэш" />

A
Anatoly Dobrokhotov, 2020-02-03
@kysocheg

Has anyone found a solution to this problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question