stockton Posted October 15, 2007 Share Posted October 15, 2007 I have a problem where most fields but not all display current data after Ajax update. Part of the web page looks like:- <tr><TD align=left>Total tickets :</td> <td align=center colspan="2" id="OutstandingValue"><?php echo $TotalTickets ?></td></tr> <tr><TD align=left>Remaining tickets:</td> <td align=center colspan="2" id="TablesValue"><?php echo $RemainingTickets ?></td></tr> <tr><TD align=left>Bundles Issued :</td><td align=center>Issued</td><td align=center>Suggestion</td></tr> <tr><TD align=left>Five Hundreds: :</td> <td align=center width=25% id="DIssued"><?php echo $DIssued ?></td> <td align=center width=25% id="DSuggestion"><?php echo $DSuggestion ?></td></tr> <tr><TD align=left>Hundreds :</td> <td align=center width=25% id="CIssued"><?php echo $CIssued ?></td> <td align=center width=25% id="CSuggestion"><?php echo $CSuggestion ?></td></tr> <tr><td>Fifties:</td> <td align=center width=25% id="LIssued"><?php echo $LIssued ?></td> <td align=center width=25% id="LSuggestion"><?php echo $LSuggestion ?></td></tr> <tr><TD align=left>Tens :</td> <td align=center width=25% id="XIssued"><?php echo $XIssued ?></td> <td align=center width=25% id="XSuggestion"><?php echo $XSuggestion ?></td></tr> <tr><td>Singles:</td> <td align=center width=25% id="IIssued"><?php echo $IIssued ?></td> <td align=center width=25% id="ISuggestion"><?php echo $ISuggestion ?></td></tr> <tr><TD align=left>Total Issued:</td> <td align=center colspan="2" id="Total"><?php echo $TotalIssued ?></td></tr> all fields except TablesValue and Total get updated correctly by my Ajax program but until I click the IE reload button these two fields do not show up correctly. The pertinant piece of the Ajax script look like:- var TablesValue = document.getElementById("TablesValue") TablesValue.value = RemainingTickets; Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 26, 2007 Share Posted October 26, 2007 var TablesValue = document.getElementById("TablesValue") TablesValue.value = RemainingTickets; change to: var TablesValue = document.getElementById("TablesValue") TablesValue.innerHTML = RemainingTickets; // use innerHTML Quote Link to comment Share on other sites More sharing options...
stockton Posted October 26, 2007 Author Share Posted October 26, 2007 I do not understand why in some cases one uses value and in others innerHTML. If someone could point me to a good HowTo or give me a simple explanation I would appreciate it. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 26, 2007 Share Posted October 26, 2007 you use innerHTML when you refer to some thing like a div or a span or a td. The value attribute only works with form fields. Quote Link to comment Share on other sites More sharing options...
stockton Posted October 27, 2007 Author Share Posted October 27, 2007 Thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.