0

I create a form in order to search by date using Spring MVC and Thymeleaf. This is the form:

<form role="form" action="#" th:action="@{buscar(fecha=${fecha})}" method="get" id="frmBuscar">
    <div class="form-group form-inline col-xs-5">
        <label>Mes</label>
        <input type="text" class="form-control input-sm monthPiker" name="fecha" id="fecha"/>
        <input type="submit" class="btn btn-primary" id="buscarRetencion" value="Buscar Retenciones"/>
    </div>
</form> 

I noticed that action value is "buscar?fecha=" instead of "buscar?fecha=5-5-2015". I need to capture the value of the field "fecha".

1 Answer 1

2

Remove fecha parameter from the form action (use th:action="@{buscar}" instead of th:action="@{buscar(fecha=${fecha})}").

There's a form field fecha and the duplicity probably causes the problem.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.