Answer the question
In order to leave comments, you need to log in
Mail not coming through custom form in modx?
Here is the standard ajaxform chunk
<form action="" method="post" class="ajax_form af_example">
<div class="form-group">
<input type="text" class="form-control" placeholder="Имя" name="name" id="af_name">
</div>
<div class="form-group">
<input type="tel" class="form-control" placeholder="Телефон" name="phone" id="af_phone">
</div>
<div class="form-group">
<button type="submit" class="btn form__btn">af_submit</button><br>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1" required>
<label class="form-check-label" for="exampleCheck1">Даю согласие на обработку персональных данных</label>
</div>
</form>
<form action="" method="post" class="ajax_form af_example">
<div class="form-group">
<input type="text" class="form-control" placeholder="Имя" name="name" id="af_name">
</div>
<div class="form-group">
<input type="tel" class="form-control" placeholder="Телефон" name="phone" id="af_phone">
</div>
<div class="form-group">
<button type="submit" class="btn form__btn">af_submit</button><br>
</div>
<div class="form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1" required>
<label class="form-check-label" for="exampleCheck1">Даю согласие на обработку персональных данных</label>
</div>
</form>
Answer the question
In order to leave comments, you need to log in
Here is this line
&validate=`name:minLength=^2^,email:email:required,message:minLength=^10^`
we read like this: “The name="name" field must be filled in and at least two characters, the name="email" field must be filled in, and according to the rules of email addresses, the name="message" field must contain at least 10 characters. Therefore, if you remove the messageaction=""
standard looks like this
<form action="" method="post" class="ajax_form af_example">
<div class="form-group">
<label class="control-label" for="af_name">af_label_name</label>
<div class="controls">
<input type="text" id="af_name" name="name" value="" placeholder="" class="form-control"/>
<span class="error_name"></span>
</div>
</div>
<div class="form-group">
<label class="control-label" for="af_email">af_label_email</label>
<div class="controls">
<input type="email" id="af_email" name="email" value="" placeholder="" class="form-control"/>
<span class="error_email"></span>
</div>
</div>
<div class="form-group">
<label class="control-label" for="af_message">af_label_message</label>
<div class="controls">
<textarea id="af_message" name="message" class="form-control" rows="5"></textarea>
<span class="error_message"></span>
</div>
</div>
<div class="form-group">
<div class="controls">
<button type="reset" class="btn btn-default">af_reset</button>
<button type="submit" class="btn btn-primary">af_submit</button>
</div>
</div>
</form>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question