Bootstrap模式不能与codeigniter form_open()一起使用

时间:2015-08-21 07:31:11

标签: html twitter-bootstrap codeigniter

Bootstrap模态代码

<!-- Signup Modal -->
<div class="modal fade" id="signUpForm" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog modal-sm">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
        </button>
        <h3 class="modal-title" id="myModalLabel">Please Sing Up</h3>
      </div>
      <div class="modal-body">
        <?php echo form_open('Registration')?>
        <div class="form-group">
          <label for="login-email" class="control-label">Email:</label>
          <input type="text" class="form-control" name="login-email" id="login-email">
        </div>
        <div class="form-group">
          <label for="username" class="control-label">Username:</label>
          <input type="text" class="form-control" name="username" id="username">
        </div>
        <div class="form-group">
          <label for="password" class="control-label">Password:</label>
          <input type="password" class="form-control" name="password" id="password">
        </div>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-primary">Signup</button>
      </div>
      <?php echo form_close()?>
    </div>
  </div>
</div>
我有控制器名为注册。当我点击按钮启动模态时没有任何反应。用于启动模态的按钮代码。

<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#signUpForm">Signup
</button>

2 个答案:

答案 0 :(得分:0)

你应该添加jQuery bootstrap“REQUEST”

此处有更多信息http://getbootstrap.com/2.3.2/javascript.html#modals

答案 1 :(得分:0)

在标头中添加对jquery和bootstrap.min.js文件的引用,并添加bootstrap css文件的链接。