单击引导下拉按钮以执行操作

时间:2015-10-29 13:04:43

标签: javascript jquery css twitter-bootstrap

<div class="btn-group pull-right">
    <button type="button" class="btn btn-primary" href="{{ url_for('account.order_complete', order_id=order.id) }}">
        <i class="glyphicon glyphicon-thumbs-up"></i> 
        Confirm Delivery
    </button>
    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
        <span class="caret"></span>
    </button>
    <ul class="dropdown-menu" role="menu">
        <li>
            <a href="{{ url_for('account.order_dispute', order_id=order.id) }}">
                <i class="glyphicon glyphicon-thumbs-down"></i> 
                Open Dispute
            </a>
        </li>
    </ul>
</div>

点击后我需要点击链接{{ url_for('account.order_complete', order_id=order.id) }}返回普通网址,但点击按钮不执行任何操作,问题出在哪里?

1 个答案:

答案 0 :(得分:0)

用以下代码替换您的代码

<div class="btn-group pull-right">
<a name="order_comp" id="order_comp" class="btn btn-primary" href="{{ url_for('account.order_complete', order_id=order.id) }}">
    <i class="glyphicon glyphicon-thumbs-up"></i> 
    Confirm Delivery
</a>
<button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
    <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
    <li>
        <a href="{{ url_for('account.order_dispute', order_id=order.id) }}">
            <i class="glyphicon glyphicon-thumbs-down"></i> 
            Open Dispute
        </a>
    </li>
</ul>