doulang6013 2017-10-26 11:54
浏览 46
已采纳

PHP - 当有人删除文章时我想要一个确认弹出窗口,因此它不会立即删除它[重复]

I have an admin panel where you can upload and delete articles from. I want a confirmation to pop up when you select the article you want to delete, to prevent the admin from accidentally deleting the articles.

<form action="delete.php" method="get" >
    <select onchange="this.form.submit();" name="article_delete">
        <?php foreach($articles as $article) { ?>
            <option value="<?php echo $article['article_id']; ?>">
                <?php echo $article['article_title']; ?>
            </option>
        <?php } ?>
    </select>
</form>
</div>
  • 写回答

2条回答 默认 最新

  • doudao9896 2017-10-26 11:58
    关注

    You can do:

    <select
        onchange="if(confirm('Are you sure?')){this.form.submit();}"
        name="article_delete">
    

    It will prompt a alert message.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 下图接收小电路,谁知道原理
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度