【发布时间】:2019-02-15 15:30:41
【问题描述】:
我的表单上有这个输入框:
<td contenteditable="true" class="date"></td>
我正在尝试向其中添加日期下拉列表,所以我所做的是:
<td contenteditable="true" class="date"><input type="date"></td>
现在当我点击发送时,它不会保存到数据库中。有没有其他方法可以做到这一点?
以下是完整代码,以备不时之需:
<table class="table table-bordered" style="border-radius: 10px;" id="crud_table">
<tr>
<th width="30%">Requested By</th>
<th width="10%">Start Date</th>
<th width="10%">Employee Name</th>
<th width="10%">Position</th>
<th width="10%">Account</th>
<th width="10%">Platform</th>
<th width="45%">Processor</th>
<th width="10%">RAM</th>
<th width="10%">Monitor</th>
<th width="10%">Phone</th>
<th width="10%">Phone Type</th>
<th width="10%">Headset</th>
</tr>
<tr>
<td contenteditable="true" class="reqname" required></td>
<td contenteditable="true" class="date"><input type="date"></td>
<td contenteditable="true" class="empname"></td>
<td contenteditable="true" class="position"></td>
<td contenteditable="true" class="account"></td>
<td contenteditable="true" class="platform"></td>
<td contenteditable="true" class="processor"></td>
<td contenteditable="true" class="ram"></td>
<td contenteditable="true" class="monitor"></td>
<td contenteditable="true" class="phone"></td>
<td contenteditable="true" class="phonetype"></td>
<td contenteditable="true" class="headset"></td>
</tr>
</table>
PS:当我点击发送时我得到All fields are required,这意味着我没有从日期下拉列表中获得任何值。
【问题讨论】:
-
您并没有真正为我们提供太多帮助。
-
@JCode 你是什么意思?你需要知道的一切都在那里,哈哈。
-
@JCode 可能提到的一些事情:问题标记为 PHP 和 MySQL,但问题中根本没有 PHP 代码或 SQL。您说“当我点击发送时”,但您发布的 HTML 中没有说明数据将如何发送到 PHP。是否涉及一些JS?桌子周围有表格吗?
-
@Don'tPanic 是的,他还说他正在“发送”数据,但他的代码中没有表格。
-
@JCode 我想
id="crud_table"可能意味着有某种 JS 库可以让表格像表格一样,但我只是猜测。
标签: php html mysql database phpmyadmin