Daniela
Daniela

Reputation: 491

Add image to label (or alongside it) using FormHelper

I have an image that i want do display alongside with the label.

<?php
    echo $this->Form->input('ticketdays',['label'=>'Ticket days']);
?>
<img src="/img/help-round-button.png">

This is what happens now. I want do display it where the blue "circle" is.

enter image description here

How to achieve this? I accept any solution I can get. Already searched stackoverflow and Google and didn't find the answer.

Thanks.

Upvotes: 1

Views: 129

Answers (1)

Daniel Bastos
Daniel Bastos

Reputation: 150

Try something like this:

<div>
    <label>Ticket days</label>
    <span style="top:50%" class="glyphicon glyphicon-info-sign"></span>
    <?php
        echo $this->Form->input('ticketdays', ['label' => false]);
    ?>
</div>

Upvotes: 2

Related Questions