TeddyKiller Posted June 26, 2010 Share Posted June 26, 2010 I have something like this - in php. <?php $onSiteContinuedDiv = ' <div style="height:1px; border:1px solid #DBE6F4; margin-bottom:6px; margin-top:4px;"></div> <table style="margin-left:40px;"> <tr> <td><span style="color:#e11919;">Sorry, you have not set any security questions. You cannot continue</span></td> </tr> </table>'; ?> <script>$(function() { $("onSiteDiv").html(<?=$onSiteContinuedDiv?>); });</script> This doesn't change the content of the onSiteDiv... and I'm not sure why. I'm wanting to change that content to $onSiteContinuedDiv ...how can I do it? What am I Missing? Quote Link to comment Share on other sites More sharing options...
F1Fan Posted June 26, 2010 Share Posted June 26, 2010 Where's the rest of your code? Do you actually have a div with an ID of "onSiteDiv"? Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted June 26, 2010 Author Share Posted June 26, 2010 Yeah. The codes long though.. I had to change it to something like this.. $onSiteContinuedDiv = ' <table style="margin-left:40px;"> <tr> <td style="text-align:right;">Secret Question</td> <td "style="text-align:left;">' . $row['secretQ'] . '</td> </tr> <tr> <td style="text-align:right;">Secret Answer</td> <td style="text-align:left;"><input type="text" size="30" name="onSiteSecretA" /></td> </tr> <tr> <td></td> <td><input type="submit" name="onSiteSubmit" class="button" /></td> </tr> </table> '; echo '<script> $(function() { $("#onSiteDiv").show(); $("#onSiteFirstForm").hide(); $("#onSiteContinuedDiv").show(); });</script>'; The overall div, is onSiteDiv.. but I've seperated it into two inner divs too. So.. one hides, one shows depending on whats what.. this works fine. but if I ever tried to use $("#mydiv").html("Some html"); it doesn't work.. it doesn't record the new html. It shows in the source code fine.. but it doesn't actually change the content of the div. 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.