【问题标题】:Confirmation box in PHPPHP中的确认框
【发布时间】:2015-10-18 11:00:45
【问题描述】:

我试图在if 子句中按下提交按钮后弹出一个确认框。如果单击“确定”,PHP 脚本会继续执行,如果单击“取消”,它将停止。

if(isset($_POST['submit'])) {
   $get_randeman = $_POST['randeman_realize'];
   if($get_randeman < $randeman_min) {
      echo '<script>confirm("Are you sure?");
          if(confirm("Are you sure?") == false) {
             return;
          } else {
          continue;
         }
   </script>';
} else {

//proceed

【问题讨论】:

  • 在php中怎么可能,你可以在客户端(javascript,jquery)做这件事

标签: javascript php jquery confirmation


【解决方案1】:

你需要这样的东西:

<a href="http://www.google.com" onclick='
            if(confirm("Are you sure?") == false) {
                return false;
            } else {
                //
            }'>google.com</a>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-01
    • 2015-08-25
    相关资源
    最近更新 更多