TeddyKiller Posted May 14, 2010 Share Posted May 14, 2010 If I have a JQuery like.. form validation, which uses an external php page to do all the validation etc if you know what I mean, upon the success: - How can I refresh a div. The div must have its contents loaded upon page load. It must also be reloaded upon the success section in an JQuery Ajax Form Validation. If you'd like to post me a code about for the validation, just let me know. Although I think I made myself clear enough to what I want to do. Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted May 14, 2010 Share Posted May 14, 2010 <head> <script type="text/javascript"> function refreshDiv() { document.getElementById("refresher").innerHTML="changed content"; } </script> </head> <body> <div id="refresher">Content</div> <a href="javascript:refreshDiv()">change the contents</a> </body> Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted May 14, 2010 Author Share Posted May 14, 2010 Thanks... although I'm more or less looking for it to include an external php file for it to load? Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted May 15, 2010 Share Posted May 15, 2010 You'd have to AJAX the result. and put it into the innerHTML Quote Link to comment Share on other sites More sharing options...
TeddyKiller Posted May 15, 2010 Author Share Posted May 15, 2010 It's not like that though. It's a form, with a button. When the button gets pressed, the ajax does it work. Now.. the form displays some information from the database. I'd like that to be refreshed. It's got nothing to do with the external php page for the form validation. Quote Link to comment Share on other sites More sharing options...
andrewgauger Posted May 15, 2010 Share Posted May 15, 2010 You can set up another ajax to get the results back from the database. If you are looking to update a form using the results, dont use innerHTML, just reference each item in the form with javascript: <body> <form name="myForm"> <input type="text" name="myText" /> </form> <body> document.myForm.myText.value=ajaxResult(); 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.