Redirecting to another part of the same page.

mike55

Contributor
Joined
Mar 26, 2004
Messages
727
Location
Ireland
Hi,

Have a page in my project which requires the user to submit a substantial amount of information. When the user clicks the "Next" button, the data they supplied is validated and the user is redirected to a specific location.

If there is a problem with some of the data submitted, I want to redirect back to where that problem occured.

I have tried to user HTMLAnchor tags, but don't seem to be having much luck, any suggestions on how I can get around this problem.

Mike55.
 
Write your js on postback

Code:
<script language="javascript">
window.location = '#Test';
</script>

<p><a name="Test"></a>testasdf</p>
 
Cool that works, however is there any way to prevent a new page being created everytime that you fire off the javascript? i.e. if you look under the listing of previous pages, you can see "n" instances of the page for the "n" number of times that you clicked the button (where n >= 0).

Mike55
 
Not sure what the previos page listing is. But, where are you doing your validation? Client or server? If client, you can integrate the input's focus function into the validation.
 
Back
Top