V
V
Vladimir2017-01-19 15:16:28
PHP
Vladimir, 2017-01-19 15:16:28

How to put Yandex - target on the button?

Good afternoon!
I have a contact form

{$ form_open() }
        <div class="body-m"> 

            { for key, message in messages.messages }
                <div class="message-{$ key } rounder">{$ messages.first(key) }</div>
            { endfor }
                            
            <div class="links">
                {$ form_label('username', lang('feedback::feedback.labels.username'), {'class': 'required'}) }
                {$ form_text('username', form_value('username'), {'class': 'txt'} ) }
                {$ form_error('username') }
            </div>

            <div class="links">
                {$ form_label('phone', lang('feedback::feedback.labels.phone')) }
                {$ form_text('phone', form_value('phone'), {'class': 'txt'} ) }
                {$ form_error('phone') }
            </div>

            <div class="links">
                {$ form_label('email', lang('feedback::feedback.labels.email'), {'class': 'required'}) }
                {$ form_text('email', form_value('email'), {'class': 'txt'} ) }
                {$ form_error('email') }
            </div>

            <div class="links">
                {$ form_label('subject', lang('feedback::feedback.labels.subject'), {'class': 'required'}) }
                {$ form_text('subject', form_value('subject'), {'class': 'txt'} ) }
                {$ form_error('subject') }
            </div>

            <div class="links">
                {$ form_label('message', lang('feedback::feedback.labels.message'), {'class': 'required'}) }
                {$ form_textarea('message', form_value('message'), {'rows' : '2'}) }
                {$ form_error('message') }
            </div>

            <div class="links captcha">
                {$ form_label('captcha', lang('cms.labels.captcha'), {'class': 'required'}) }
                {$ form_captcha('captcha', {'class': 'txt'}) }
                {$ form_error('captcha') }
                <div class="hints">{$ lang('cms.hints.captcha') }</div>
            </div>
        
        </div>
        
        <div class="footer-m">
            {$ form_submit(lang('cms.buttons.send'), {'class': 'btn'}) }
            {$ anchor('', lang('cms.buttons.cancel'), {'class': 'btn modal-close'})}
        </div>        
    {$ form_close() }

I need to set a Yandex metric target.
onclick="yaCounterXXXXXXX.reachGoal('send')"
I don't understand where to put it. Usually placed in a field like
<input class = "btn" type = "submit" value = "Отправить">

There is no such thing here

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dev400, 2017-01-19
@dev400

logically here
But I have no idea what this code is, not the fact that it will work

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question