【发布时间】:2013-08-26 21:37:02
【问题描述】:
我有一个 HTML 表格,里面有一些输入字段(只是标准的东西 - 它是一个订单),我要做的就是提取数据,以便我可以将其插入到电子邮件中。
除了从我发布到 php 电子邮件函数的表中提取数据之外,我还有其他所有工作。
我已经在谷歌上搜索了所有可能的解决方案(jQuery、javascript 等),但我还没有找到合适的解决方案。我得到的最接近的是简单地使用$(this).html(),但它不会提取输入值。
我觉得这应该是一个非常简单的解决方案,但我可以找到它。
这是我的表格示例,其中包含一些虚拟数据:
<table id="order-table">
<tr>
<th>Product Name</th>
<th>Quantity</th>
<th>X</th>
<th>Unit Price</th>
<th>=</th>
<th style="text-align: right; padding-right: 30px;">Totals</th>
</tr>
<tr class="odd">
<td class="product-title">Dell R720 Xeon Server</em></td>
<td class="qty"><input type="text" class="qty-input"></input></td>
<td class="times">X</td>
<td class="price-per-unit">£<span>1006</span></td>
<td class="equals">=</td>
<td class="row-total"><input type="text" class="row-total-input" disabled="disabled"></input></td>
</tr>
<tr class="even">
<td class="product-title">VMWare Standard</em></td>
<td class="qty"><input type="text" class="qty-input"></input></td>
<td class="times">X</td>
<td class="price-per-unit">£<span>306</span></td>
<td class="equals">=</td>
<td class="row-total"><input type="text" class="row-total-input" disabled="disabled"></input></td>
</tr>
<tr>
<td colspan="6" style="text-align: right;">
ORDER SUBTOTAL: <input type="text" class="total-box" value="£0" id="product-subtotal" disabled="disabled"></input>
</td>
</tr>
</table>
任何帮助都会得到极大的欢迎。
【问题讨论】:
-
你为什么不使用表单或者你想用 AJAX 来做呢?
-
我不介意任何一种方式。我要做的就是创建一个简单的订单表格,提交后会通过电子邮件发送给收件人。