I like to set trigger on Jquery based framework.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title>Trigger scroll</title>
    <script type="text/javascript" src="jquery.js"></script>
</head>

<body>
We have found an error on your page with form. Please modify this input field.<a id="scroll" href="javascript:void(0);">Please go go to the last error</a>
</body>

</html>

If there is an error it will scroll to this error. I'm using validation like:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

Should I use ScrollTo like URL:
http://flesler.blogspot.com/2007/10/jqueryscrollto.html
or this is not needed as error is my trigger position.
How to set also link to this error with scroll?
Need help.

Member Avatar for stbuchok

Someone can correct me if I'm wrong, but if you set focus to the field that has a validation error, I believe the page will automatically scroll it into view. So you might just need to set focus to the control.

Someone can correct me if I'm wrong, but if you set focus to the field that has a validation error, I believe the page will automatically scroll it into view. So you might just need to set focus to the control.

Can you post please example on my case sample.Thanks.

Member Avatar for stbuchok

I'm sorry but I don't have time to write this for you. Just look up how to use the focus() method and try it out to see if it works. If you get suck at a specific part, post the code and where you are stuck and we will help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.