I Am Coo Man
06-10-2003, 03:38 AM
Hi can you help me with a few simple questions? First being the one in the title.
How can I just go right to the most bottom of the page with Javascript apon l0ading of page? ALso its in an iframe if that matters but I want the Iframe to scroll to its most bottom. No fancy slow scrolling just quick go 2 bottom.
Second is auto refocus. I'm making a chat and I want it so that when I press enter the cursur automatically goes back to the chat input (just a form element) but I dunno how. Heres what I have I dont know why it doesnt work.
I have a main page and within that two iframes. In one Iframe I have this JS code...
<script language="JavaScript">
<!--
function sub_form()
{
document.form1.message.value='';
document.form1.message.focus();
}
-->
</script>
In the head tag. Then of course I have a text input called 'message' in a form called form 1 all within that same iframe. Then for activation of this code, in the body tags I have the form do this.. (still in same iframe)
<form action="page.php?" method="post" name="form1" target="chatList" onSubmit='setTimeout("sub_form()", 10);'>
Yet it doesnt refocus yet it does delete the value of the form input called 'message'
Anyone can help me to get this to work?
Thanks for any help! I greatly apreciate :)
How can I just go right to the most bottom of the page with Javascript apon l0ading of page? ALso its in an iframe if that matters but I want the Iframe to scroll to its most bottom. No fancy slow scrolling just quick go 2 bottom.
Second is auto refocus. I'm making a chat and I want it so that when I press enter the cursur automatically goes back to the chat input (just a form element) but I dunno how. Heres what I have I dont know why it doesnt work.
I have a main page and within that two iframes. In one Iframe I have this JS code...
<script language="JavaScript">
<!--
function sub_form()
{
document.form1.message.value='';
document.form1.message.focus();
}
-->
</script>
In the head tag. Then of course I have a text input called 'message' in a form called form 1 all within that same iframe. Then for activation of this code, in the body tags I have the form do this.. (still in same iframe)
<form action="page.php?" method="post" name="form1" target="chatList" onSubmit='setTimeout("sub_form()", 10);'>
Yet it doesnt refocus yet it does delete the value of the form input called 'message'
Anyone can help me to get this to work?
Thanks for any help! I greatly apreciate :)