myztacia
07-05-2005, 12:09 PM
I'm creating a php/mysql chatroom and would like to add some javascript to enhance it. The goal: to not use frames...it would be a piece of cake if I used frames [I've created several chats before]. The chat is set to automatically refresh every 15 seconds. When a user is typing in the textarea and the chat refreshes, it erases what they've typed already. What I want to do is to put whatever is typed (using onChange) on the URL part of the meta tag...so that when it refreshes, php may grab the value of the URL and put it into the textbox again [on the refreshed page], then set focus to that box [on the end].
I REALLY am clueless when it comes to javascript, so I have virtually nothing to begin with.
form:
<form name='chatform' method='post' action='http://kittentracks.com/chat.php'>
Message: <input type='text' name='message' size=40 maxlength=255 onChange='urlChange(chatform.message.value);'>
<input type='submit' name='post_msg' value='Submit'>
</form>
javascript: - I have no idea what to do for here x.x
<script>
function urlChange(message)
{
var message = message;
}
</script>
meta tag: - replace $message with whatever the javascript returns
<meta http-equiv='refresh' content='2;url=http://kittentracks.com/chat.php?message=$message'>
I'm sorry you'll basically be coding this for me if you choose to help me...I honestly have no idea where to go with it x.x
I REALLY am clueless when it comes to javascript, so I have virtually nothing to begin with.
form:
<form name='chatform' method='post' action='http://kittentracks.com/chat.php'>
Message: <input type='text' name='message' size=40 maxlength=255 onChange='urlChange(chatform.message.value);'>
<input type='submit' name='post_msg' value='Submit'>
</form>
javascript: - I have no idea what to do for here x.x
<script>
function urlChange(message)
{
var message = message;
}
</script>
meta tag: - replace $message with whatever the javascript returns
<meta http-equiv='refresh' content='2;url=http://kittentracks.com/chat.php?message=$message'>
I'm sorry you'll basically be coding this for me if you choose to help me...I honestly have no idea where to go with it x.x