表单

时间:2016-03-02 17:16:41

标签: php forms input submit

我知道语法很可能是里程数,但是我想知道是否有人可以建议我的提交按钮为什么不做任何事情,但是当我删除表单标签之间的代码时它工作正常,接受它to action.php

#team {
  margin-left: 50px;
  outline: none;
}
#teamselection {
  padding-top: 25px;
  padding-left: 100px;
  line-height: 150%;
}
/*#arsenal{
display:none;
} over-ridden by some script displaying this is checkbox is selected*/

input[type="number"].money2,
.money3,
.money4,
.money5,
.money6,
.money7,
.money8,
.money9,
.money10 {
  display: none;
  /*over-ridden by checking the checkbox to show the requested element*/
  width: 100px;
  margin: 10px 0px 25px 50px;
}
#teamSubmit {
  background: #CCCCCC;
  margin-bottom: 100px;
}
<form name="ticketSales" method="post" action="action.php">

  <select id="team">
    <option>Please select your team...</option>
    <option value="arsenal">Arsenal</option>
    <option value="astonvilla">Aston Villa</option>
    <option value="bournemouth">Bournemouth</option>
    <option value="chelsea">Chelsea</option>
    <option value="crystalpalace">Crystal Palace</option>
    <option value="everton">Everton</option>
    <option value="leicester">Leicester City</option>
    <option value="liverpool">Liverpool</option>
    <option value="mancity">Manchester City</option>
    <option value="manutd">Manchester United</option>
    <option value="newcastle">Newcastle</option>
    <option value="norwich">Norwich City</option>
    <option value="stoke">Stoke City</option>
    <option value="southampton">Southampton</option>
    <option value="sunderland">Sunderland</option>
    <option value="swansea">Swansea</option>
    <option value="tottenham">Tottenham Hotspur</option>
    <option value="watford">Watford</option>
    <option value="westbrom">West Bromwich Albion</option>
    <option value="westham">West Ham United</option>
  </select>
  <br>

  <div id=teamselection>

    <div id="arsenal">
      Select your season ticket seating section
      <br>
      <select id="Section" name="Section">
        <option>Please select...</option>
      </select>
      <br>Row
      <input type="text" required name="seatRow" style="width:50px;margin-left:10px;margin-right:10px;">Seat
      <input type="text" required name="seatNumber" style="width:50px;margin-left:10px;margin-right:10px;">
      <br>Select which games you wish to share your season ticket for
      <br>
      <input type="checkbox" class="game2" value="Car">Swansea
      <br>
      <input type="number" required name="money2" class="money2" placeholder="&pound;">
      <br>
      <input type="checkbox" class="game3" value="Car">West Bromwich Albion
      <br>
      <input type="number" required name="money3" class="money3" placeholder="&pound;">
      <br>
      <input type="checkbox" class="game4" value="Car">Watford
      <br>
      <input type="number" required name="money4" class="money4" placeholder="&pound;">
      <br>
      <input type="checkbox" class="game5" value="Car">Crystal Palace
      <br>
      <input type="number" required name="money5" class="money5" placeholder="&pound;">
      <br>
      <input type="checkbox" class="game6" value="Car">Norwich
      <br>
      <input type="number" required name="money6" class="money6" placeholder="&pound;">
      <br>
      <input type="checkbox" class="game7" value="Car">Aston Villa
      <br>
      <input type="number" required name="money7" class="money7" placeholder="&pound;">
      <br>
    </div>
  </div>

  <input type="submit" id="teamSubmit">
</form>

任何有关整理代码的提示也会受到赞赏。非常感谢提前。

1 个答案:

答案 0 :(得分:1)

您的样式设置为 display:none; 由于输入字段是必需的,因此浏览器无法关注元素,因此无法提交。

在您的风格中启用显示器以获得金钱*,然后您就可以看到它的工作原理。