提交按钮不能使用HTML

时间:2017-04-13 06:38:31

标签: html

点击“登录”,没有,不进行表格,可以帮助我吗?

代码:

        <form method="POST" action="" id="login">
        <div class="input-group">
          <span class="input-group-addon" id="basic-addon1">
            <i class="fa fa-user" aria-hidden="true"></i></span>
          <input type="text" class="form-control" placeholder="Username" name="Username" aria-describedby="basic-addon1" required>
        </div>
        <div class="input-group"> 
          <span class="input-group-addon" id="basic-addon2">
            <i class="fa fa-key" aria-hidden="true"></i></span>
          <input type="password" class="form-control" placeholder="Password" name="Password" aria-describedby="basic-addon2" required>
        </div>
        <div class="text-center">
            <input type="submit" form="login" class="btn btn-success btn-submit" value="Login">
        </div>
    </form>
什么是错的?可以帮我? uPDATE 代码:https://hastebin.com/wemerigodu.scala

3 个答案:

答案 0 :(得分:3)

制作表单时,您输入了: <form method="POST" action="" id="login>" 要使表单工作,请键入包含要登录的代码的文件名,例如:

<form method="POST" action="login_verify.php" id="login">
    <div class="input-group">
      <span class="input-group-addon" id="basic-addon1">
        <i class="fa fa-user" aria-hidden="true"></i></span>
      <input type="text" class="form-control" placeholder="Username" name="Username" aria-describedby="basic-addon1" required>
    </div>
    <div class="input-group"> 
      <span class="input-group-addon" id="basic-addon2">
        <i class="fa fa-key" aria-hidden="true"></i></span>
      <input type="password" class="form-control" placeholder="Password" name="Password" aria-describedby="basic-addon2" required>
    </div>
    <div class="text-center">
        <input type="submit" form="login" class="btn btn-success btn-submit" value="Login">
    </div>
</form>

答案 1 :(得分:1)

位于表单外部的按钮(但仍然是表单的一部分)。

并且您有一个页面操作属性,可以接收提交的字段的值。

<form action="Your_Handle_Page" method="get" id="form1">
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
</form>

<button type="submit" form="form1" value="Submit">Submit</button>

答案 2 :(得分:1)

您还没有在表单提交上指定操作,您需要在表单操作元素中编写重定向网址,如下所示。

<form method="POST" action="xyz.html" id="login">
    <div class="input-group">
      <span class="input-group-addon" id="basic-addon1">
        <i class="fa fa-user" aria-hidden="true"></i></span>
      <input type="text" class="form-control" placeholder="Username" name="Username" aria-describedby="basic-addon1" required>
    </div>
    <div class="input-group"> 
      <span class="input-group-addon" id="basic-addon2">
        <i class="fa fa-key" aria-hidden="true"></i></span>
      <input type="password" class="form-control" placeholder="Password" name="Password" aria-describedby="basic-addon2" required>
    </div>
    <div class="text-center">
        <input type="submit" form="login" class="btn btn-success btn-submit" value="Login">
    </div>
</form>