亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

內嵌確認按鈕

內嵌確認按鈕

飲歌長嘯 2023-10-16 10:36:22
我是模態按鈕的新手。由于某種原因,“刪除”按鈕不顯示“您確定要刪除嗎?”的問題。并簡單地執行刪除操作。我需要顯示確認,這是一個重要的驗證。我一直在尋找解決方案,但目前還沒有結果。我附上源代碼。任何指導將不勝感激。謝謝。<style>  body {    margin: 0;    font-family: Arial, Helvetica, sans-serif;}.topnav {    overflow: hidden;    background-color: #333;}.topnav a {    float: left;    display: block;    color: #f2f2f2;    text-align: center;    padding: 14px 16px;    text-decoration: none;    font-size: 17px; } .topnav a:hover {    background-color: #ddd;    color: black; } .topnav a.active {    background-color: #4CAF50;    color: white; } .topnav .icon {    display: none; } p.centrartextoparrafo {    text-align: center;    padding: 16px 16px;    text-decoration: none;    font-size: 17px; } h1.centrartextoh1titulopaginaprincipal {    text-align: center; } h2.centrartextoh2titulopaginaprincipal {    text-align: center; } #copyright {    float: left;    padding-bottom: 10px;    padding-top: 10px;    text-align: center;    bottom: 0px;    width: 100%; } table.center {    margin-left:auto;     margin-right:auto; } table, th, td {    border: 20px solid white; } @media screen and (max-width: 600px) {    .topnav a:not(:first-child) {display: none;}    .topnav a.icon {    float: right;    display: block; } } @media screen and (max-width: 600px) {    .topnav.responsive {position: relative;}    .topnav.responsive .icon {    position: absolute;    right: 0;    top: 0; } .topnav.responsive a {    float: none;    display: block;    text-align: left; }   }</style>我附上顯示兩個按鈕的屏幕截圖。編輯按鈕工作正常;刪除按鈕在刪除記錄之前不會顯示確認問題。
查看完整描述

2 回答

?
暮色呼如

TA貢獻1853條經驗 獲得超9個贊

onClick事件解決方案


function checkFunction() {

    if (confirm("Confirm")) {

      return true

    }

    return false

}

<input type="submit" onclick="return checkFunction();" class="btn btn-danger" data-toggle="confirmation" {# data-title="?Are you sure to delete?" #} value="Delete">


查看完整回答
反對 回復 2023-10-16
?
翻閱古今

TA貢獻1780條經驗 獲得超5個贊

https://img1.sycdn.imooc.com/652ca217000114b510150347.jpg

<h2 class="centrartextoh2titulopaginaprincipal">Nadadores</h2>


<table class="table table-hover">


    <tr>

        <th scope="col">CI</th>

        <th scope="col">Nombre</th>

        <th scope="col">Apellido</th>

        <th scope="col">Correo Electronico</th>

    <th scope="col">Telefono</th>

    <th scope="col"></th> <!-- Espacio de columna para el boton Editar   -->

    <th scope="col"></th> <!-- Espacio de columna para el boton Eliminar -->

    </tr>



    {% for nadador in nadadores %}

        <tr>

            <td>{{ nadador.cedula }}</td>

            <td>{{ nadador.name }}</td>

            <td>{{ nadador.surname }}</td>

            <td>{{ nadador.email }}</td>

       <td>{{ nadador.phone }}</td>

      <td class="text-right">

        <div class="row">

          <form action="{{ url_for('nadadores_delete') }}" method="post" class="pull-right">

           <input type="hidden" name="id" value="{{ nadador.id }}">

           <input type="submit" class="btn btn-danger" data-toggle="confirmation" data-title="?Esta seguro?" value="Eliminar">

          </form>

          <a class="btn btn-primary pull-right" href="{{ url_for('edit_nadador', id=nadador.id) }}">Editar</a>

        </div>

      </td>

    {% endfor %}

    </table>



{# 

  Solution:


  JS

  https://getbootstrap.com/docs/4.0/getting-started/introduction/


  Many components require the use of JavaScript to function. Specifically, they 

  require jQuery, Popper.js, and JavaScript plugins. 

  Place the following TAG script's near the end of your pages, right before the closing 

  body tag, to enable them. jQuery must come first, then Popper.js, and then our 

  JavaScript plugins.  

 #}


    <script src="{{ url_for('static', filename='js/jquery-3.2.1.min.js') }}"></script>

    <script src="{{ url_for('static', filename='js/bootstrap.min.js') }}"></script>

    <script src="{{ url_for('static', filename='js/bootstrap-confirmation.min.js') }}"></script>

    <script src="{{ url_for('static', filename='js/main.js') }}"></script>

 {% endblock %}


查看完整回答
反對 回復 2023-10-16
  • 2 回答
  • 0 關注
  • 122 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號