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 submit_button in volt...i had tried something like this.....Can someone help? {{ submit_button("Edit<i class='glyphicon glyphicon-pencil'></i> ", "class": "btn btn-info btn-lg") }}

edited Dec '16


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 text_field and button_field side by 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") }}


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?

Or input-group?