S
S
sovalngro2018-10-10 11:58:04
MODX
sovalngro, 2018-10-10 11:58:04

Not receiving messages via AjaxForm in MODX Revo?

Greetings, there are two forms on the site, one in the modal window on all pages of the site, the second on the contact page in the body of the page, and so messages do not come from the second form.
modal form

<form class="form" method="post" action="" data-smodx-productcls="callme" role="form">
<input  class="form-control input-sm" type="hidden" name="nospam:blank" value="" />
<input class="form-control input-sm" type="hidden" name="work-email" value="" />
    <div class="form-group">
        <label>Имя:<sup class="surely">*</sup></label>
        <input type="text" name="name" required="" class="form-control input-sm" placeholder="Ваше имя*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group">
        <label>Телефон:<sup class="surely">*</sup></label>
        <input type="text" class="form-control input-sm" name="phone" required="" placeholder="Ваш телефон*" value="">
        <span class="error error_name"></span>
    </div>
    <div class="form-group dopolnitelno">
      <label for="dopolnitelno">Дополнительно:<sup class="surely">*</sup></label>
      <div class="">
          <input type="text" class="form-control input-sm dopolnitelno" name="dopolnitelno" placeholder="Дополнительная информация" value="" />
      </div>
  </div>
    <div>
        <p><span style="float:left;font-size: 8px;">отправляя заявку, вы соглашаетесь с <a href="/confidense.html" nofollow="" target="_blank">политикой конфиденциальности</a></span></p>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Отмена</button>
        <input name="submit" name="form2" type="submit" class="btn btn-primary" onclick="yaCounter22063858.reachGoal('otpr_zak_zv');ga('send', 'event', 'otpr', 'obr_zvonok');return true;" value="Отправить">
        
        
    </div>
</form>

Modal Form Email
<h3>Сообщение</h3>
    <p>От кого: </p>
    <p>Телефон: </p>

On the page

Contact page form
<form name="order_form" action="" method="post" class="form form-horizontal" role="form" id="contact-form">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3>Написать нам</h3>
    </div>
    <div class="panel-body">
      <div class="control-group {if $form_result.field_errors.fullname}error{/if}">
        <label for="fullname">Имя<span class="text-danger">*</span></label>
        <div class="">
          <input id="fullname" class="form-control" placeholder="Как вас зовут?" type="text" value="" name="fullname">
        </div>
      </div>
      <div class="control-group {if $form_result.field_errors.email}error{/if}">
        <label for="email">Электронная почта<span class="text-danger">*</span></label>
        <div class="">
          <input id="email" class="form-control" placeholder="Адрес электронной почты" type="email" value="" name="email">
        </div>
      </div>
      <div class="control-group {if $form_result.field_errors.phone}error{/if}">
        <label for="telephone">Телефон<span class="text-danger">*</span></label>
        <div class="">
          <input id="telephone" class="form-control" placeholder="Номер телефона для связи" type="text" value="" name="phone">
        </div>
      </div>
      <div class="control-group {if $form_result.field_errors.message}error{/if}">
        <label for="message">Комментарий</label>
        <div class="">
          <textarea rows="10" id="message" class="form-control" placeholder="Ваш вопрос или пожелание" name="message"></textarea>
        </div>
      </div>
      <div class="control-group {if $form_result.field_errors.phone}error{/if} dopolnitelno">
        <label for="dopolnitelno">Дополнительно<span class="text-danger">*</span></label>
        <div class="">
          <input type="text" class="dopolnitelno" name="dopolnitelno" value="" />
        </div>
      </div>
    </div>
    <div class="panel-footer">
      <input type="submit" class="btn btn-warning" name="form1" value="Отправить" />
    </div>
  </div>
</form>

Email on contact page
<h3>Сообщение</h3>
    <p>От кого: </p>
    <p>E-mail: </p>
    <p>Телефон: </p>
    <p>Сообщение: </p>

On the page

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan, 2018-10-10
@ruslan_aleev

Hello, there was an error once with a modal form - the modal form script cut the entire form into its window and, accordingly, the class for AjaxForm was outside the form and the form did not work, maybe that's the problem.

D
DreamOff, 2018-10-25
@DreamOff

&validate=` name:required ,email:required,message:required,dopolnitelno:blank`
and on the page you have input id=" fullname "
name in validation should be changed to fullname
and telephone would be added to validation

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question