Page 1 of 1
Goto end of page
Posted: Sun Aug 28, 2005 5:46 am
by winsonlee
I have a text box in a form. Everytime when the submit button is pressed, the information entered will be displayed above the text box. After pression on the submit button for ten times, the amount of information on the page gets more. I wonder how can i make in sucha way that when the page is displayed , it goes to the end of the page ??
Posted: Sun Aug 28, 2005 7:44 am
by jayshields
you explained that poorly, and you havent got any code to show us.
so i can only hazard a guess that you are using an action="SAMEPAGE" in the form, and then cheking if $_POST['submit'] is set at the top of the page, and if it is, i guess you are printing/echoing some text.
if i guessed right, then instead of using echo or w/e in the "if (isset($_POST['submit']))" conditional, use something like $message .= "whatever" and build up a message, then where ever on the page you wanna show your message just do
Code: Select all
if (isset($message)) {
echo $message;
}
i hope i helped somehow...
Posted: Sun Aug 28, 2005 8:36 am
by feyd
using scrollIntoView() (Javascript) during the onload event would jump the page down. You could also use a hash anchor, which will be far more universal.
Posted: Sun Aug 28, 2005 10:02 am
by s.dot
Code: Select all
<body onLoad="document.location = '#form';">
..........
<form id="form" .....
.........
Posted: Sun Aug 28, 2005 7:28 pm
by winsonlee
thanks for da code..
it does work