Return Focus to Specific Control on Web Page

R

R. Wagoner

When a page posts back to itself, I want to return focus
to the control (button) that caused the post. How do I
accomplish this?

The web page is more than one page and I don't want them
to have to scroll down to where they were.
 
M

MD WebsUnlimited.com

Hi R. Wagoner,

There is not enough information here to provide a specific answer. I'm
assuming that by button you mean the submit button and if so then you'd
write code into the button that would be executed upon return.

<input type="submit" name="sub1" value="Post"
onclick="this.form.hiddenscript.value = 'document.' + this.form.name + '.' +
this.name + '.focus();'" >
<input type="hidden" name="hiddenscript" >


The code in the ASP page would be:

<body onload="<% =request.form("hiddenscript") %>" >

Notes: The form must be named which FP will do automatically.
The submit button must be named - I used sub1 above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top