Goto end of page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
winsonlee
Forum Commoner
Posts: 76
Joined: Thu Dec 11, 2003 8:49 pm

Goto end of page

Post 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 ??
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

Code: Select all

<body onLoad="document.location = '#form';">

..........

<form id="form" .....
.........
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
winsonlee
Forum Commoner
Posts: 76
Joined: Thu Dec 11, 2003 8:49 pm

Post by winsonlee »

thanks for da code..
it does work
Post Reply