Saturday, March 28, 2009

[jQuery] Re: Redirect to anchor after form submit

I've just found this plugin that seems to work fine and the minified
version is only 2 kb ... :

http://flesler.blogspot.com/2007/10/jqueryscrollto.html

Is this the best way ?

Thankyou.

Jsbeginner a écrit :
>
> Hello,
>
> I've got a simple form with a return false function to stop it being
> submitted as I use ajax to update it. However I've come accross a
> functional problem : if the user's screen is to small and he has not
> scrolled down enough then he doesn't see the search results and gets
> the impression nothing has happened. Is it possible to have a form
> submit button that does not send the form but redirects the page to an
> anchor (id) on the page, so if the user submits the form and the
> result is not visible on the page, the page automaticaly scrolls down
> to the form so the user can see what is happening ?
>
> I suppose I could generate a link which would show only after the
> submit button has been clicked to scroll down to see result, but it
> would be alot nicer if I could make the page go down to an "id" and
> act like a link to anchor at the same time as updating the page with
> the ajax answer.
>
> I hope I've been clear enough and that this is possible ...
>
>

No comments: