S
Stuffman
I think it may be possible to make a chatroom entirely in Javascript.
Everything works fine, but it doesnt go out to the whole world. I'm
trying to fix this. Here's what i have so far:
Chat box:
<textarea readOnly
cols="26"
rows="5"
name="textfield">Welcome to (website) Chat!</textarea>
Post box:
<input type="text" name="chat"></input>
Submit button:
<input type="submit" name="Submit" value="Send"
onclick="if (guest.checked) textfield.value+=chat.value+=enter.value;
else textfield.value+=error.value+=enter.value
f('textfield')">
Scroll down code (textarea):
<script type="text/javascript">
function f(ta_id){
var d=document, ta, rng;
if(d.all){
ta=d.all[ta_id];
if(ta && ta.createTextRange){
rng=ta.createTextRange();
rng.collapse(false);
rng.select();
}
}
}
</script>
"Login as Guest" option (required for post):
<input type="checkbox" name="guest" onClick="var guest1=prompt('Enter
a guest username.'); alert('Logged in as Guest');
guest.disabled=this.checked">Login as Guest</input>
The rest of the code is just all of the things it needs to post
properly. Find a way to hide these from view. I used Microsoft Office
Publisher and covered it with an autoshape.
"Not logged in" message:
<input type="text" name="error" value="You are not logged in. Please
select the box above to login as a guest."></input>
Enter (seperates posts):
<textarea name="enter">
</textarea>
That's what I have so far. But one question: How can I gewt it to post
to the whole world? Any help?
Everything works fine, but it doesnt go out to the whole world. I'm
trying to fix this. Here's what i have so far:
Chat box:
<textarea readOnly
cols="26"
rows="5"
name="textfield">Welcome to (website) Chat!</textarea>
Post box:
<input type="text" name="chat"></input>
Submit button:
<input type="submit" name="Submit" value="Send"
onclick="if (guest.checked) textfield.value+=chat.value+=enter.value;
else textfield.value+=error.value+=enter.value
f('textfield')">
Scroll down code (textarea):
<script type="text/javascript">
function f(ta_id){
var d=document, ta, rng;
if(d.all){
ta=d.all[ta_id];
if(ta && ta.createTextRange){
rng=ta.createTextRange();
rng.collapse(false);
rng.select();
}
}
}
</script>
"Login as Guest" option (required for post):
<input type="checkbox" name="guest" onClick="var guest1=prompt('Enter
a guest username.'); alert('Logged in as Guest');
guest.disabled=this.checked">Login as Guest</input>
The rest of the code is just all of the things it needs to post
properly. Find a way to hide these from view. I used Microsoft Office
Publisher and covered it with an autoshape.
"Not logged in" message:
<input type="text" name="error" value="You are not logged in. Please
select the box above to login as a guest."></input>
Enter (seperates posts):
<textarea name="enter">
</textarea>
That's what I have so far. But one question: How can I gewt it to post
to the whole world? Any help?