0

下面是我正在使用的引导代码。表单正确显示(来自包含文件)。当我提交表单时,所有字段都将变量传递到下一页 - 除了下拉元素

我曾经在 1994 年到 2008 年间建立网站。这是我第一个使用 bootstrap 的网站。以及我自 2009 年以来的第一个网站。

<div class="col-md-3 col-sm-12 col-xs-12">
<div class="white-box">
<h3 class="box-title">Add User</h3>

以下行是我将表单发布到的位置。那是我检查后端数据库以添加用户或给出用户存在的错误的地方。

<form id="add-user" method="post" action="/dcs/admin/confirmAddUser.html" role="form">

<div class="messages"></div>
<div class="controls">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label for="form_ID">ID</label>
<input id="form_ID" type="text" name="id" id="focusedInput" class="form-control" placeholder="ID Number *" required="required" data-error="ID is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="form_pass">Password</label>
<input id="form_pass" type="text" name="pass" class="form-control" placeholder="Employee Password *" required="required" data-error="Password is required.">
<div class="help-block with-errors"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label for="form_fName">Name</label>
<input id="form_fName" type="text" name="fName" class="form-control" placeholder="First *" required="required" data-error="Name is required.">
<div class="help-block with-errors"></div>
</div>
</div>

<div class="col-md-3">
<div class="form-group">
<label for="form_lName">.</label>
<input id="form_lName" type="text" name="lName" class="form-control" placeholder="Last *" required="required" data-error="Name is required.">
<div class="help-block with-errors"></div>
</div>
</div>

下面根据 Stackoverflow 的警告缩短了 :) 我通常有十二个月的时间。

<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="form_birthMonth">Birth Month</label>
<select id="birthMonth" class="form-control" required="required" data-error="Birth Month is required.">
<option VALUE="Jan">January</option>
<option VALUE="Feb">February</option>
<option VALUE="Mar">March</option>
</select>
<div class="help-block with-errors"></div>
</div>
</div>

下同,我通常有 31 天。

<div class="col-md-2">
<div class="form-group">
<label for="form_birthDay">Day</label>
<select id="birthDay" class="form-control" required="required" data-error="Birth Day is required.">
<option VALUE="1">1</option>
<option VALUE="2">2</option>
<option VALUE="3">3</option>
<option VALUE="4">4</option>
<option VALUE="5">5</option>
</select>
<div class="help-block with-errors"></div>
</div>
</div>
</div>

<div class="col-md-6">
<div class="form-group">
<label for="form_email">Email</label>
<input id="form_email" type="email" name="email" class="form-control" placeholder="Employee email *" required="required" data-error="Valid email is required.">
<div class="help-block with-errors"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="form_phone">Phone</label>
<input id="form_phone" type="tel" name="phone" class="form-control" placeholder="Employee phone *">
<div class="help-block with-errors"></div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="form_position">Position</label>
<input id="form_position" type="text" name="position" class="form-control" placeholder="Employee Position *" required="required" data-error="Employee Position is required.">
<div class="help-block with-errors"></div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="form_groups">Groups</label><br />
<div class="checkbox-inline">
<label class="checkbox-inline"><input type="checkbox" value="Technician">Technician</label>
<label class="checkbox-inline"><input type="checkbox" value="Parts">Parts</label>
<label class="checkbox-inline"><input type="checkbox" value="Reports">Reports</label>
<label class="checkbox-inline"><input type="checkbox" value="Database Mgr">Database Mgr</label>
<label class="checkbox-inline"><input type="checkbox" value="Admin">Admin</label>
<div class="help-block with-errors"></div>
</div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-4">
<div class="form-group">
<label for="form_shiftStart">Shift Start</label>
<select class="form-control" id="startshift">
<option VALUE="0600">6:00</option>
<option VALUE="0630">6:30</option>
<option VALUE="0700">7:00</option>
<option VALUE="0730">7:30</option>
<option VALUE="0800">8:00</option>
<option VALUE="0830">8:30</option>
<option VALUE="0900">9:00</option>
<option VALUE="0930">9:30</option>
<option VALUE="1000">10:00</option>
<option VALUE="1030">10:30</option>
<option VALUE="1100">11:00</option>
<option VALUE="1130">11:30</option>
<option VALUE="1200">12:00</option>
</select>
</div>
</div>

<div class="col-md-4">
<div class="form-group">
<label for="form_shiftStart">Shift Start</label>
<select class="form-control" id="endshift">
<option VALUE="0600">6:00</option>
<option VALUE="0630">6:30</option>
<option VALUE="0700">7:00</option>
<option VALUE="0730">7:30</option>
<option VALUE="0800">8:00</option>
<option VALUE="0830">8:30</option>
<option VALUE="0900">9:00</option>
<option VALUE="0930">9:30</option>
<option VALUE="1000">10:00</option>
<option VALUE="1030">10:30</option>
<option VALUE="1100">11:00</option>
<option VALUE="1130">11:30</option>
<option VALUE="1200">12:00</option>
</select>
</div>
</div>

<div class="col-md-4">
<div class="form-group">
<label for="form_LunchStart">Lunch Start</label>
<select class="form-control" id="startshift" type="text">
<option VALUE="0600">6:00</option>
<option VALUE="0630">6:30</option>
<option VALUE="0700">7:00</option>
<option VALUE="0730">7:30</option>
<option VALUE="0800">8:00</option>
<option VALUE="0830">8:30</option>
<option VALUE="0900">9:00</option>
<option VALUE="0930">9:30</option>
<option VALUE="1000">10:00</option>
<option VALUE="1030">10:30</option>
<option VALUE="1100">11:00</option>
<option VALUE="1130">11:30</option>
<option VALUE="1200">12:00</option>
</select>
</div>
</div>
</div>

<div class="row">
<div class="col-md-12">
<div class="form-group">
<label for="form_assignedLots">Assigned Location(s)</label>
<textarea id="form_assignedLots" name="assignedLots" class="form-control" placeholder="Work Locations *" rows="4" required="required" data-error="Assigned Location(s)."></textarea>
<div class="help-block with-errors"></div>
</div>
</div>
</div>

<div class="row">
<div class="col-md-9"></div>
<div class="col-md-3">
<input type="submit" class="btn btn-success btn-send" value=" Add User ">
</div>
</div>
</div>

<input id="form_login" type="hidden" name="login" value="Y" class="form-control">
</form>
</div>
</div>

上述表格来自我们购买的符合引导程序的主题。我使用的后端脚本语言/数据库是 WebDNA——尽管此时还没有进入问题。

4

2 回答 2

0
<select id="birthMonth" NAME="GIVE_SOME_NAME_HERE" class="form-control" required="required" data-error="Birth Month is required.">
<option VALUE="Jan">January</option>
<option VALUE="Feb">February</option>
<option VALUE="Mar">March</option>
</select>

未设置选择字段的名称属性。确保已设置

于 2016-10-09T05:54:11.243 回答
0

您需要将名称属性设置为示例“名称”属性是您的服务器端客户端在发布表单时将检查的内容

于 2016-10-09T05:57:50.967 回答