Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to add an image to button in volt

i want to add a glyphicon icon to submitbutton in volt...i had tried something like this.....Can someone help? {{ submitbutton("Edit<i class='glyphicon glyphicon-pencil'></i> ", "class": "btn btn-info btn-lg") }}



19.5k
Accepted
answer
edited Dec '16

Hi,

something like this will do the trick:

                {{ tag_html("button", ["type":"submit","class": "btn btn-primary"]) }}
                Edit <i class='glyphicon glyphicon-pencil'></i>
                {{ tag_html_close("button") }}

thanks a lot!!! Can you please help in one more thing..... I want both textfield and buttonfield side by side......how i do this?

                        {{ text_field('search_criteria', 'class': "search-control",'placeholder':"Location,Department,Band....or Employee ID") }}
    {{ tag_html("button", ["type":"submit","class": "btn btn-primary"]) }}
    <i class='glyphicon glyphicon-search'></i>
    {{ tag_html_close("button") }}


19.5k

Always the same:

        {{ tag_html("textarea", ["cols":"30","row": "4","class":"form-control","placeholder":"Send"]) }}

        {{ tag_html_close("textarea") }}

Do you mean a button-group in bootstrap?

http://getbootstrap.com/components/#btn-groups

Or input-group?

http://getbootstrap.com/components/#input-groups