Help - Search - Members - Calendar
Full Version: how to do this..
Invision Power Services > Community Forums > Community Web Design and Coding
sallam
Greetings

I'm trying to setup a forum in my board to be used like chatting. Posting as usual, but the page reloads every 10 sec. so that reading new posts is always updated. I'll use this forum for scheduled interviews and meetings.

I'm using a skin thats dedicated for that forum, and a simple refresh meta tag in the global header.
The problem is that if someone if typing to post, in the quick reply box, and the page gets refreshed automatically, the typed text may be lost, and its annoying users.

Is there a way to stop the refresh when someone is typing?
For example, a javascript to use, instead of a refresh meta tag, that controls when to refresh and when not to?
.Jack
Yeh.. you could do that.. Are you planning to integrate this into IPB?

Anyway.. Roughly what you would do is something like:

CODE
<script>
function doReload(){
      var typingBox = document.form1.textarea.value;

      if (!typingBox){
           window.location.reload();
      }

      setTimeout('doReload()', 10000);
}

setTimeout('doReload()', 10000);
</script>


Haven't tested but it should work...
sallam
Thanks JCXP, and yes, its for IPB
Where should I paste your code above? in the skin wrapper?
and does it go betweeb the HEAD tags or the BODY tags?

One more question, do I replace the word 'form1' with 'REPLIER'?
.Jack
well form1 and textarea will need to be replaced with the form name and name of the textbox ... look in the html for these

And put it in the head
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.