M
M
Michael_E2016-04-26 20:52:33
JavaScript
Michael_E, 2016-04-26 20:52:33

AmoCRM form redirect script?

You need to make sure that after the successful submission of the form, a redirect occurs.
Now the form only shows the message:

e56856671ec144f8bdbd8828af66497a.png
The form code is inserted into the page like this:

<!-- amoforms_form -->
<script>var amo_forms_params = {id: XXXXX, hash: 'XXXXX', locale: 'ru'};</script>
<script id="amoforms_script" async="async" src="https://forms.amocrm.ru/forms/assets/js/amoforms.js"></script>


It generates a form:
<form id="amoforms_form" class="amoforms-form amoforms-view-form" action="https://forms.amocrm.ru/queue/add" method="post">
  ...
  <div id="button_submit_wrapper">
    <button type="submit" id="button_submit" class="">Отправить</button>
  </div>
</form>


Such a java script works on a regular form, but not on the generated AmoCRM :
$("#amoforms_form").submit(function(event) {
  event.preventDefault();
  window.location.href = "http://ya.ru";
});

Tell me what needs to be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
yokodn1na, 2021-05-18
@yokodn1na

You go into your amocrm account - select the form you are integrating - there are three points at the top - select "form settings" - at the bottom there will be an item "Actions after submitting the form", check the box and drop the necessary link there - you're done.
The question is already 3 years old, but it can be useful to someone.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question