Answer the question
In order to leave comments, you need to log in
Why doesn't AjaxForm work in MODx?
Hello!
I'm trying to send a message from the site to the mail. But the message is not sent, an error is displayed in the browser log:
VM1036 jquery.form.min.js:7 Uncaught TypeError: Cannot read property 'success' of undefined
at w.fn.init.e.fn.ajaxSubmit (VM1036 jquery.form. min.js:7)
at HTMLFormElement. (VM1034 default.js:16)
at HTMLDocument.dispatch (VM1031 jquery-3.3.1.slim.min.js:2)
at HTMLDocument.v.handle (VM1031 jquery-3.3.1.slim.min.js:2)
ajaxForm chunk code:
<form action="#" method="post" class="ajax_form af_example">
<div class="form-group">
<span class="error_name"></span>
<input type="text" class="form-control" placeholder="Ваше имя" name="name" value="">
</div>
<div class="form-group">
<span class="error_email"></span>
<input type="email" class="form-control" placeholder="Email" name="email" value="">
</div>
<div class="form-group">
<span class="error_message"></span>
<textarea class="form-control" rows="3" placeholder="Сообщение" name="message" value=""></textarea>
</div>
<button type="submit" class="btn btn-primary btn-block" value="Отправить">Отправить</button>
</form>
<h3>Сообщение</h3>
От кого: <br>
Email: <br>
Текст сообщения:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question