View Full Version : javascript problem??

01-22-2006, 10:36 AM
Hello frens of CF
This is my first question regarding JS...
I have made a simple chatroom....
it has 3 frames , one for displaying messages ,second for entering the messages and third for displaying the online usersn and logout link.......
i had got some problems listed as...
>when the scroll bar appears in the message displaying frame then the scrolling is in up direction but i want the scrolling to the down(automatic) so the user dont have to scroll down for reading the messages
>when tried to chat in private with more than one ,than the pop up window is replaced by another rather than opening a new pop up
>when tried to Logout by clicking the button in 3rd frame the page redirects to the login page in third frame only...but i want to redirection should go to the whole page
>when message is entered in field , then by clicking enter button didnt work ..but it works by clicking the mouse to the send button..but i want to make it work by clicking the enter button which may be easier..
>whent the message is entered and sent the message remains in the field but i want to clear the text from the field once the message is sent and the cursor should remain in the field for further entering

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::
that's the problem i am suffering from...
Please help me in the topic specified with the codes .....
Again Thank you in advance

01-23-2006, 07:47 AM
>Put an anchor in the last message

<a name="bottom"></a>This is the last message.
and then the form action URL should end with #bottom.

>Use different window target for each member.

w = window.open(url, "user1");
w2 = window.open(url, "user2");

Take note that space is not allowed in target name, and also special characters except underscore.

>redirecting to the topmost window:

window.open(url, "_top");

>when there is only one text field and a button, the form is automatically submitted when Enter key is pressed.

>In onload of the messages list page, reset the message field in the other frame.

<body onload="parent.frames['targetFrame'].document.forms[0].messageField.value=''; parent.frames['targetFrame'].document.forms[0].messageField.focus();">

01-27-2006, 09:35 AM
Thanks alot for the help:::::
if problem continues then i will consult you again