Jump to content

Scrollto


gum1982

Recommended Posts

 

Hello i am not sure if this is a JavaScript question or a php question so sorry first.

 

Here is my problem i have a survey which is really long so you have to scroll down the page right to the bottom after filling it out and then clicking submit, the survey scrolls all the way to the top again i really don't want this to happen.

 

After it has been submited i want it to scroll dynamically to the bottom. here is some of my code.

<FORM METHOD="post" ACTION="" id="check">
<table>

//whole survey form here//

</table>

<table>   
<input type="submit" name="signup" id="submit_btn" value="" />
</table>

if(isset($_POST[signup])){
	///////////////////////////////////////////////////////////////////////////
echo "<script langauge=\"javascript\">alert(\"Thank you We've received your Business Check. We will get back to you shortly!\");</script>";
}

 

How can i run some code after the alert to send the user to the bottom off the page can someone please tell me what is the best way to do this????

 

Link to comment
Share on other sites

Really it is an HTML question. You want to look into anchor tags an example of what you will need:

 

<FORM METHOD="post" ACTION="#bottom" id="check"><table>

//whole survey form here//

</table>

<table>
<a name="bottom"></a>   
<input type="submit" name="signup" id="submit_btn" value="" />
</table>

 

I believe that is how it would work, so when the form submits it will automatically scroll to that anchor tag (notice in the form action you have the #bottom).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.