Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 引导模式立即消失_Html_Twitter Bootstrap_Bootstrap Modal - Fatal编程技术网

Html 引导模式立即消失

Html 引导模式立即消失,html,twitter-bootstrap,bootstrap-modal,Html,Twitter Bootstrap,Bootstrap Modal,我的网站上有一张表格。当提交按钮被激活时,我希望一个引导模式出现并保持,直到您按下模式上的按钮返回主菜单。 模态出现一秒钟,然后消失。当我按下浏览器窗口上的“后退”按钮时,模式将出现并保持,直到我按下模式窗口上的“确定”按钮。 有什么解决方案的建议吗 <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device

我的网站上有一张表格。当提交按钮被激活时,我希望一个引导模式出现并保持,直到您按下模式上的按钮返回主菜单。 模态出现一秒钟,然后消失。当我按下浏览器窗口上的“后退”按钮时,模式将出现并保持,直到我按下模式窗口上的“确定”按钮。 有什么解决方案的建议吗

<html lang="en">

<head>
    <meta charset="utf-8">    
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="css/bootstrap_cerulean.min.css" rel="stylesheet">
    <style type="text/css">
    body {padding-top:20px;}    </style>
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    <script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js">           </script>
</head>

<body>
<div class="container">
<div class="row">
  <div class="col-md-6 col-md-offset-3">
    <div class="well well-sm">
      <form class="form-horizontal" action="" method="post">
       <fieldset>
        <legend class="text-center">Udlevering af rute</legend>

        <!-- Bud input-->
        <div class="form-group">
          <label class="col-md-3 control-label" for="Bruger">Avisbud</label>
          <div class="col-md-9">
            <input id="Bruger" name="Bruger" type="text" placeholder="Skriv bud navn" class="form-control">
          </div>
        </div>

        <!-- Avisrute nr.-->
        <div class="form-group">
          <label class="col-md-3 control-label" for="Rute nr">Rute nr.</label>
          <div class="col-md-9">
            <input id="Rute nr" name="Rute nr" type="text" placeholder="Skriv rute nr." class="form-control">
          </div>
        </div>

        <!-- Form actions -->
        <div class="form-group">
          <div class="col-md-12 text-center">
            <button type="submit" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#udlevering_Modal">Udlevér rute</button>
          </div>
        </div>
      </fieldset>
      </form>
    </div>
  </div>
</div>
</div><script type="text/javascript">
</script>
</body>
</html>


<html lang="en">

<head>
<meta charset="utf-8">    
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/bootstrap_cerulean.min.css" rel="stylesheet">
<style type="text/css">
    body {padding-top:20px;}    </style>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.1.0/js/bootstrap.min.js">       </script>
</head>

<body>
<div class="modal fade" id="udlevering_Modal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
      <div class="row">
      <div class="col-md-6 col-md-offset-3">
      <div class="well well-sm">
         <div class="alert alert-success" role="alert">Rute udleveret.</div><br />
        <a class="btn btn-lg btn-primary btn-large" href="manuel_opret.php" role="button"><span class="glyphicon glyphicon-briefcase"></span>  Til manuel menu &raquo;</a> 
        </div>
     </div>
  </div>
</div><script type="text/javascript">
</script>
</body>
</html>

有几个问题。您有多个HTML和body标记。您只需要带有第一个HTML/Body标记的modal div


其次,您不希望模态作为表单上的提交按钮。请尝试键入=按钮。

两个问题。您有多个HTML和body标记。您只需要带有第一个HTML/Body标记的modal div


其次,您不希望模态作为表单上的提交按钮。试试type=button。几天前我也遇到了同样的问题,但dis技巧对我有效,只需将按钮类型更改为锚定标记,如下所示。 e、 g

据我所知,问题的原因可能是它试图提交表单,这就是模态立即消失的原因
希望我能帮助你

前几天我也遇到了同样的问题,但dis技巧对我有效,只需将按钮类型更改为锚定标记,如下所示。 e、 g

据我所知,问题的原因可能是它试图提交表单,这就是模态立即消失的原因
希望我能帮助你

也许这一个可以帮助你似乎已经解决-可能重复的@RamizWachtler是正确的。这段代码显然是双重加载引导JS头,然后是正文,这在链接的帖子中有说明。也许这段代码可以帮助你解决这个问题-可能重复的@RamizWachtler是正确的。这段代码显然是双重加载引导JS头,然后是正文,这在链接的帖子中有说明。
<a type="submit" class="btn btn-primary" data-toggle="modal" href="#myModal">Submit</a>