Firefox 立即自动关闭表单
编辑:已修复,我刚刚删除了表格并将其设为无表格,它需要一些 css 来对布局进行排序,但可以跨浏览器工作,谢谢大家。
我有一个非常奇怪的问题,我'我正在尝试在 oscommerce 中制作 AJAX 快速订单表格。除了这段代码之外,一切都很顺利:
while ($sql_results = tep_db_fetch_array($sql_query)) {
$sout2 = "<tr>";
$sout2 .= '<form id="pp'. $sql_results['products_id'] . '" method="get" action="quickorder.php"></tr><tr>';
$sout2 .= "<td valign=\"top\" width=\"100\"><b><a href=\"" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $sql_results['products_id']) . "\">" . $sql_results['products_model'] . "</a></b></td>";
$sout2 .= "<td valign=\"top\" width=\"300\">" . $sql_results['products_name'] . "</td>";
//$sout .= "<td valign=\"top\" width=\"100\">" . tep_image(DIR_WS_IMAGES . $sql_results['products_image'], $sql_results['products_name'], 50, 50) . "</td>";
$sout2 .= "<td valign=\"top\" width=\"150\"><input type=\"hidden\" id=\"pid\" name=\"pid\" value=\"" . $sql_results['products_id'] . "\" /><input id=\"pqty\" name=\"pqty\" type=\"text\" value=\"1\" /></td>";
$sout2 .= "<td valign=\"top\" width=\"50\"><input type=\"submit\" value=\"Add\" /></td>";
$sout2 .= "</form>";
$sout2 .= "</tr>";
echo $sout2;
}
这使得 Firefox 立即关闭表单标签:
<form id="pp266" method="get" action="quickorder.php"></form>
IE 正确地处理表单。
EDIT : Fixed, I just removed the tables and made it tableless, it will require abit of css to sort the layout but is working cross browser, thank you everyone.
I have a really weird issue, I'm trying to do a AJAX quick order form in oscommerce. All is going well apart from this code:
while ($sql_results = tep_db_fetch_array($sql_query)) {
$sout2 = "<tr>";
$sout2 .= '<form id="pp'. $sql_results['products_id'] . '" method="get" action="quickorder.php"></tr><tr>';
$sout2 .= "<td valign=\"top\" width=\"100\"><b><a href=\"" . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $sql_results['products_id']) . "\">" . $sql_results['products_model'] . "</a></b></td>";
$sout2 .= "<td valign=\"top\" width=\"300\">" . $sql_results['products_name'] . "</td>";
//$sout .= "<td valign=\"top\" width=\"100\">" . tep_image(DIR_WS_IMAGES . $sql_results['products_image'], $sql_results['products_name'], 50, 50) . "</td>";
$sout2 .= "<td valign=\"top\" width=\"150\"><input type=\"hidden\" id=\"pid\" name=\"pid\" value=\"" . $sql_results['products_id'] . "\" /><input id=\"pqty\" name=\"pqty\" type=\"text\" value=\"1\" /></td>";
$sout2 .= "<td valign=\"top\" width=\"50\"><input type=\"submit\" value=\"Add\" /></td>";
$sout2 .= "</form>";
$sout2 .= "</tr>";
echo $sout2;
}
This makes firefox close the form tags straight away:
<form id="pp266" method="get" action="quickorder.php"></form>
IE does the forms correctly.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
彻底检查您的标记。你有这样的东西,
这会立即关闭 tr,导致所有嵌套元素也关闭(FF 行为,IE 行为不同)。因此,替换
为
另外,将表单移到行外可能是一个好主意,因为某些浏览器不允许
form
标记出现在tr
内,只允许 <代码>td和th
。Examine your markup thoroughly. You have something like
This closes the tr right away, causing all nested elements to close as well (FF behaviour, IE behaves differently). So, replace
with
Also, it might be a good idea to move the form outside the row, as some browsers do not allow
form
tag to appear inside thetr
, onlytd
andth
.