Thymeleaf: How to make a button link to another html page?

Viewed 31937

I have an input button in my html page. I want to link the button to another html page with thymeleaf. This is my code.

<form id="hotDealForm" th:action="@{/hot-deal-step-1}">
    <div class="col-xs-12 col-sm-6 col-md-6">
        This Hot deal
        <br/>
        <input type="button" value="Continue to schedule" class="btn btn-red"/>
    </div>
</form>

My controller works fine. (I'm working with spring mvc). But I can't figure out what the problem is. I can do the same task using html. But when I am using thymeleaf its not working. That is when I clicked the button nothing happens.

2 Answers

Adding the method as 'post' fixed the issue

<form id = "hotDealForm" th:action = "@{/hot-deal-step-1}"  method="post">

    <div class="col-xs-12 col-sm-6 col-md-6">
        This Hot deal
        <br/>
    <input type="button" value="Continue to schedule" class="btn btn-red" />
    </div>

</form>
Related