[[+content_image]]
S
S
SM_ST2021-11-29 11:01:00
MODX
SM_ST, 2021-11-29 11:01:00

How to display values ​​in Modx?

there is a form

[[!FormIt?
               &hooks=`email, redirect,FormItSaveForm`
               &emailTpl=`zayavkaEmailTpl1`
               &emailTo=`[email protected]`
               &emailFrom=`[email protected]`
               &emailSubject=`Новая заявка на [[pdoField? &id=`0` &field=`pagetitle`]] на сайте na-goru!`
               &redirectTo=`134`
               &validate=`rule:required`
               &formName=`Заявка `
               &formFields=`field`
               &fieldNames=`date_start==Дата начала,date_end==Дата окончания,about==Доп текст`
            ]]




<form name="contactForm" id="contact-form" class="contact-form form form-equival" method="post" action="">
            <div class="row-fluid">
                <label>Ваше ФИО (полностью)</label>
                <input class="input" required type="text" name='fields[0][name]'>
            </div>
           
            <div class="row-fluid">
                <label>Ваш E-mail</label>
                <input class="input" required type="email" name='fields[0][email]'>
            </div>
            <div class="row-fluid" >
                <label>Ваш телефон (в международном формате)</label>
                <input class="input" required type="text" name="fields[0][phone]">
            </div>
        </form>

emailTpl chunk

{foreach $fields as $field index=$i}
   {$field[phone]}
   {$field[email]}
{/foreach}

nothing comes to the mail, or rather these fields are not there

Answer the question

In order to leave comments, you need to log in

[[+comments_count]] answer(s)
A
Alexey Golyagin, 2021-12-20
@webrevenue

In the input form, change to:

<input class="input" required type="text" name="name">
<input class="input" required type="email" name="email">
<input class="input" required type="text" name="phone">

And the handler (emailTpl) will be like this:
<p><strong>Имя</strong>: {$name}</p>
<p><strong>Почта</strong>: {$email}</p>
<p><strong>Телефон</strong>: {$phone}</p>

or (without phenom):
<p><strong>Имя</strong>: [[+name]]</p>
<p><strong>Почта</strong>: [[+email]]</p>
<p><strong>Телефон</strong>: [[+phone]]</p>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question