Bootstrap:" has-error"班级不显示

时间:2015-07-02 17:34:51

标签: twitter-bootstrap

我在我正在处理的系统中有一个小表格,它会接收银行授权码并相应地更新帐户。

我正在进行验证,首先尝试提交没有提供代码的表单。

我在其他地方使用has-error课程没有问题,但在这种情况下,它似乎无法正常工作:

<div class="col-md-6 col-md-offset-3">
    <div class="panel panel-default">
        <div class="panel-heading">
            Bart Foo - Payment Received
            <div class="label label-info pull-right">Transfer</div>
        </div>
        <div class="panel-body">
            <form action="/Payments/Update/dQyQyALT3kqPRxcxLclKRQ" method="post">
                <div class="form-group has-errror">
                    <label for="ref-code">Please enter the reference number for the Transfer.</label>
                    <input type="text" placeholder="You must enter a reference code" name="ref-code" class="form-control">
                    <p>
                        <small>The user will see this authorization code in the registration portal.</small>
                    </p>
                    <p>
                        Upon approving this payment, a confirmation email will immediately be sent to the user at this address: <code>bart.foo@example.com</code>
                    </p>
                </div>
                <div class="row">
                    <div class="col-md-4 col-md-offset-8">
                        <input type="submit" value="Approve Payment" class="form-control pull-right btn-default">
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

结果:

has-error

has-error已应用于容器div,其为form-group,并且包含input并已应用form-control。我错过了什么?

1 个答案:

答案 0 :(得分:2)

您的问题很简单:您在代码中写了has-errror而不是has-error

<div class="form-group has-error">

Working bootply link