forms - div call to javascript stops working after styling table -
i have javascript uses div call php file. has been working ok. working on appearance of webpage adding styles table , seems have broken div.
here javascript
<script type="text/javascript"> function getnextcheck(str) { if (str=="") { document.getelementbyid("checkno").innerhtml=""; return; } if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("checkno").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","getnextcheck.php?id="+str,true); xmlhttp.send(); } window.onload = function() { document.getelementsbyname('id')[0].onchange(); } </script>
here website html.
<form id="paybills" method="post" action=""> <br /><table style="border-collapse:collapse; "> <tr><th style="padding-left:4px; border:1px solid #dddddd; background-color:#efefef; color:black;" width="50">select</th><th style="padding-left:4px; border:1px solid #dddddd; background-color:#efefef; color:black;" width="165">bank</th><th style="padding-left:4px; border:1px solid #dddddd; background-color:#efefef; color:black;" width="185">account number</th><th style="padding-left:4px; border:1px solid #dddddd; background-color:#efefef; color:black;" width="150">current balance</th></tr> <?php $i=0; while($row2 = mysql_fetch_array($result2)) { $id = $row2['id']; $checked = $i?'':'checked'; echo "<tr><td style=\"padding-left:16px; border:1px solid #dddddd;\"><input type=\"radio\" name=\"id\" value=\"".$row2['id']."\" {$checked}></td><td style=\"padding-left:4px; border:1px solid #dddddd;\">".$row2['name']."</td><td style=\"padding-left:4px; border:1px solid #dddddd;\">".$row2['acctnum']."</td>"; $i=1; $result7 = mysql_query("select sum(deposit), sum(withdrawal) bankaccount_transaction bankaccount_id = '$id'") or die(mysql_error()); $row7 = mysql_fetch_array($result7); $deposit = $row7['sum(deposit)']; $withdrawal = $row7['sum(withdrawal)']; $total = $deposit - $withdrawal; $newtotal = number_format($total,2); echo "<td style=\"padding-left:4px; border:1px solid #dddddd;\">$".$newtotal."</td></tr>"; } ?> </table> <br /> <div id="checkno"></div> <br /><br /> <input type="submit" name="submit" value="pay" /> </form>
for heck of it, tried substituting span instead of div did not work either.
thanks help!!
i don't understand tag:
{$checked}
why don't use instead:
... ".$checked." ...
Comments
Post a Comment