D
D
denism3002019-02-23 11:00:12
MODX
denism300, 2019-02-23 11:00:12

How to fix modx form validation error?

Chunk tplModalCallback

<div class="modal fade" id="modalCallback" tabindex="-1" role="dialog" aria-labelledby="modalCallbackTitle" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="modalCallbackTitle">Форма обратной связи</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                
            </div>
        </div>
    </div>
</div>

Chunk contactForm
<form method="post">
    <div class="form-group">
        <input type="text" name="name" required="" class="form-control" placeholder="Ваше имя*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <input type="email" name="email" class="form-control" placeholder="Ваш email*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <input type="text" class="form-control" id="phone" name="phone" required="" placeholder="Ваш телефон*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <textarea rows="4" name="message" required="" class="form-control word-count" data-maxlength="200" data-info="textarea-words-info" placeholder="Сообщение*"></textarea>
        <span class="error error_name"></span>
    </div>
    <div class="form-group form-check">
        <input type="checkbox" class="form-check-input" id="privacyCheck" required="">
        <span class="error error_name"></span>
        <label class="form-check-label" for="privacyCheck">Согласен на обработку персональных данных</label>
    </div>
    <p class="text-small">Ставя отметку, я даю свое согласие на обработку моих персональных данных в соответствии с законом №152-ФЗ «О персональных данных» от 27.07.2006 и принимаю условия <a href="" rel="nofollow" target="_blank">Пользовательского соглашения</a></p>
    <div class="text-center">
        <button type="submit" class="btn btn-landcad big-btn">Отправить</button>
    </div>
    
    
</form>

tplContactForm Chunk
<p>Имя: </p>
<p>Email: </p>
<p>Телефон: </p>
<p>Сообщение: </p>

when sending, it swears at an error in the email field, although it is excluded from validation
at the same time, messages arrive in the site admin panel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Tarasov, 2019-02-23
@an-tar

Which is strange.
How do they get into your admin? Are you processing letters or is a separate ajax request flying? The snippet code shows that no one saves "to the admin".
Do you have any more JS code that is tied to validation?? Could this be his contribution?
Alternatively, replace the email field name with, say, email2, what happens?
Additionally, try setting emailFrom and emailReplyTo

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question