P
P
photosho2020-03-05 17:35:36
MODX
photosho, 2020-03-05 17:35:36

Can't find the specified shape key?

The site is on ModX, all pages are loaded at once and scrolled through as in a slider - this is how the site is made. Several pages use ajaxForm and the following error occurs on submit:

Cannot find the specified form key


There is an assumption that this is due to the presence of several forms on the page. What else could be the problem, who faced? How can you decide?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
P
photosho, 2020-03-06
@photosho

Thanks everyone for the helpful advice. The problem in the end was different: the form was connected using markup, bypassing ModX.

A
Anton Tarasov, 2020-03-05
@an-tar

AjaxForm is just a wrapper for Formit, look at the last submitVar value, it must be set.

A
Alexander Lunegov, 2020-03-05
@alelunegov

photosho , form submit buttons also need a name attribute equal to submitVar in Formit (AjaxForm).


<form method="post" action="" id="form-1">
  .......
  <input type="submit" name="form1" class="btn" value="Отправить" />
   .............
</form>

<form method="post" action="" id="form-2">
  .......
  <input type="submit" name="form2" class="btn" value="Отправить" />
  .............
</form>

If instead you <input type="submit">use <button type="submit">Отправить</button>, then you can add a hidden field in the form:
<input type="hidden" name="form3" value="1" />

D
Dmitry, 2020-03-06
@i__dmitry

It's even more likely that the problem is that you called the cached AjaxForm. Call with "!":
[[!AjaxForm?....
or
{'!AjaxForm' | snippet : [...]}
Because multiple forms without any submitVar work just fine with AjaxForm.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question