In the user registration section of the third section of Chapter 10 of the TP5.1 tutorial, the bootstrap menu drop-down cannot be displayed, and script verification cannot be performed.
走过沙漠的骆驼
走过沙漠的骆驼 2021-09-20 13:50:37
0
3
889

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

走过沙漠的骆驼
走过沙漠的骆驼

reply all(2)
走过沙漠的骆驼

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

  • reply I didn't touch this code, how could it start running? Picture sense
    autoload author 2021-09-21 09:21:17
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template