表格代码缺少什么?

时间:2014-10-19 03:28:59

标签: html forms

首次在Stackoverflow上发帖,你能告诉我这段代码缺少什么吗?它应该是一个表单,但“提交”按钮什么都不做。谢谢!

  <div class="container">
   <span class="reg"> <h1>Register Now</h1> </span>
    <div class="row">
      <div class="conent-part">
       <div class="form-body">
        <div class="fome-body">
          <form>
            <div class="row">
                <div class="form-part">
                    <div class="form-group">
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Your Name">
                    </div>
                    <div class="form-group">
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Your Email Address">
                    </div>
                    <div class="form-group">
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nominee's Name">
                    </div>
                    <div class="form-group">
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nominee's Email">
                    </div>
                </div>
                <div class="form-part">
                    <div class="form-group">
                        <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Nominee's Sport">
                    </div>
                    <div class="form-group">
                        <textarea class="form-control" rows="3" placeholder="Accomplishments"></textarea>
                    </div>
                </div>

            </div>
            <div class="custom_btn">
                    <button type="button" class="btn btn-primary btn2">Submit</button>
                </div>
          </form>

2 个答案:

答案 0 :(得分:0)

<button type="button"> 

没有默认行为,如果您要提交仅使用<button>的表单而未定义type属性(submit是默认值)。

See the docs for more info.

答案 1 :(得分:0)

更改

<div class="custom_btn">
                <button type="button" class="btn btn-primary btn2">Submit</button>
</div>

<div class="custom_btn">
                <button type="submit" class="btn btn-primary btn2">Submit</button>
</div>

只需输入type = button,您只需告诉我们它的按钮没有为其说明功能.type =“submit”会自动将表单提交到指定的URL。