I assume here that with a chat type application you need part of the page to refresh itself and display the newer messages as new entries are typed in?
The trick here to to use frames, one side holds the text field and the submit buttons and the other displays the messages. The page that displays the messages needs to have a header that causes the page to refresh itself at certain intervals...
<META http-EQUIV="REFRESH" Content="60">
This will automatically refresh the page every 60 (See content) seconds
You can change the length to be a shorter period to refresh quicker...
hth
Bastien