-1

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.

1 Answers1

0

Examine your markup thoroughly. You have something like

<tr><form ...></tr>

This closes the tr right away, causing all nested elements to close as well (FF behaviour, IE behaves differently). So, replace

$sout2 .= '<form id="pp'. $sql_results['products_id'] . '" method="get" action="quickorder.php"></tr><tr>';

with

$sout2 .= '<form id="pp'. $sql_results['products_id'] . '" method="get" action="quickorder.php"><tr>';

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 the tr, only td and th.

J0HN
  • 26,063
  • 5
  • 54
  • 85