简体   繁体   English

单击提交按钮时不执行任何操作

[英]Submit button does nothing when clicked

When the submit button is clicked nothing happens.当提交按钮被点击时,什么也没有发生。 Only clicks and won't call the controller method.只点击,不会调用控制器方法。 Completely unsure why.完全不知道为什么。 I have tried multiple methods of submit.我尝试了多种提交方法。 Both external form and inline forms.外部形式和内联形式。

<table border="1">
        <tr>
            <td><spring:message code="label.id" /></td>
            <td><spring:message code="label.name" /></td>
            <td><spring:message code="label.abv" /></td>
            <td><spring:message code="label.Buy" /></td>
            <td><spring:message code="label.Sell" /></td>
            <td><spring:message code="label.LastMod" /></td>
            <td><spring:message code="label.Description" /></td>
            <td><spring:message code="label.image" /></td>
            <td><spring:message code="label.catagory" /></td>
            <td><spring:message code="label.style" /></td>
            <td><spring:message code="label.actions" /></td>
        </tr>
        <c:forEach items="${Beers}" var="Beers"> 
            <tr>
                <td>${Beers.id}</td>
                <td>${Beers.name}</td>
                <td>${Beers.abv}</td>
                <td>${Beers.buyPrice}</td>
                <td>${Beers.sellPrice}</td>
                <td>${Beers.lastMod}</td>
                <td>${Beers.description}</td>
                <td><img src="../assets/images/no_image.jpg" alt="<spring:message code="label.image" />"/></td>
                <td>${Beers.catId}</td>
                <td>${Beers.styleId}</td>
                <td>
           //PROBLEM HERE 
            <form:form method="POST" action="/TasteLimerickBeersB/Beers/UpdateBeerPrice?id=${Beers.id}" modelAttribute="priceIncrease">

                <label for="priceIncrease"><spring:message code="label.percentage" /></label>
                <input type="text" name="priceIncrease" maxlength="4" max="100" pattern="[+-?0-9]+([\.][0-9]{0,2})?">

                <button type="submit" value="Submit!"><spring:message code="submit.button" /></button>
            </form:form>

        </td>
    </tr>

</c:forEach>

<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 任何落入相同陷阱的人都缺少这一行......

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM