chipowski Posted July 28, 2010 Share Posted July 28, 2010 Hi all. Apologies if this has been answered before but I've searched the forums and spent hours on the net going through every site listed to find out how to do this and come up with nothing so far. Does anyone have some code to refresh the content of a div based on an onChange event from a form? All I can find is a time based refresh - listed below - which does work fine. But I need the event to be user controlled rather than time based. Any help will be greatly appreciated. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script> <script> var auto_refresh = setInterval( function() { $('#loaddiv').load('data_page.php'); }, 20000); </script> Quote Link to comment Share on other sites More sharing options...
radar Posted July 29, 2010 Share Posted July 29, 2010 well thats easy... onchange="runthis();" function runthis() { $('TransMsgDisplay').innerHTML='<img src="../templates/admin/img/indicator.gif" align="center">'; } this of course has sno real ajax involved but you should be able to figure out the rest Quote Link to comment Share on other sites More sharing options...
chipowski Posted July 29, 2010 Author Share Posted July 29, 2010 cool thanks for the info. i'm very new to ajax so it'll take me some time but now i know what to look into. ta Quote Link to comment Share on other sites More sharing options...
chipowski Posted July 29, 2010 Author Share Posted July 29, 2010 sorted. got it working perfectly now. thanks so much for your help. i've been tearing my hair out trying to solve this. 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.