I got this PHP page where I get data from a database and turns it into a link through javascript.
It works well on Google Chrome and IE but doesn't work at all on Firefox. Any idea why? Thanks a bunch :)

<script type="text/javascript">
function submitform(action)
  {
    document.forms("pSubCategory" + action + "").submit();
  }
</script>
<? 
  $counter = 1;
  do { 
?>
<tr onMouseOver="this.style.backgroundColor='#E1EAFE'"; onMouseOut="this.style.backgroundColor='transparent'">
<td style="padding-left:10px;"> 
<form action="hardware.php" method="post" name="pSubCategory<? echo $counter; ?>">
<font size="2" color="#333333">
<a href="javascript: submitform(<? echo $counter; ?>);"><font color="black" style="text-decoration:underline;"><?php echo $row_subcatset2['pSubCategory']; ?></font></a>
</font>
<input name="sc" type="hidden" value="pSubCategory" />
<input name="st" type="hidden" value="<?php echo $row_subcatset2['pSubCategory']; ?>" />
</form>
</td>
</tr>
<?
  $counter = $counter + 1;
  } while ($row_subcatset2 = mysql_fetch_assoc($subcatset2));	
?>

Recommended Answers

All 2 Replies

Solved it by changing

document.forms("pSubCategory" + action + "").submit();

to

document.forms["pSubCategory" + action + ""].submit();

Can't find the delete button for this thread though ._.

there is no delete button. just a 'mark as solved'.
don't forget to check your other browsers whether they still work :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.