The preliminary implementation of the user registration function in Chapter 10 and Section 3 of the Tianpeng teacher TP5.1 tutorial cannot display the bootstrap drop-down menu and cannot pop up
The second problem is that script verification cannot be implemented
<script> $(function(){ $("#register").on('click',function(){ alert($('#login').serialize()); }) }) </script>
Even this verification failed, why?
<form class="form-horizontal" method="post" id="login"> <div class="form-group"> <label class="col-sm-2 control-label">用户名:</label> <div class="col-sm-10"> <input type="text" name="name" class="form-control" placeholder="UserName"> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">邮 箱:</label> <div class="col-sm-10"> <input type="text" name="email" class="form-control"> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">手机号:</label> <div class="col-sm-10"> <input type="text" name="mobile" class="form-control"> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">密 码:</label> <div class="col-sm-10"> <input type="password" name="password" class="form-control"> </div> </div> <div class="form-group"> <label class="col-sm-2 control-label">确认密码:</label> <div class="col-sm-10"> <input type="password" name="password_confirm" class="form-control"> </div> </div> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <button type="submit" class="btn btn-primary" id="register">注册</button> </div> </div> </form>
This is the form. I have watched the before and after videos 3 times, and there is no problem with the code.
<link rel="stylesheet" href="/static/css/bootstrap.css"> <script type="/static/js/jquery-3.6.0.min.js"></script> <script type="/static/js/bootstrap.min.js"></script>
JS has also been introduced
The environmental tests of my new computer in my hometown were all normal, but when I returned home, I reinstalled TP5.1 and rewrote simple code, but it didn't work either. Why is this? Is it related to the operating system? It shouldn’t be. My hometown is WIN10 and this is WIN7. Does it matter if I block the control? It shouldn’t be. I’m fine with the examples in Bootstrap.
I don’t know what’s going on. Do I need to reinstall the system?
I went back to my hometown and installed a new computer. The newly installed environment was TP5.1. I simply typed these codes and everything was solved. It was magical. . never mind