Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Field Focus

Status
Not open for further replies.

toddsalcedo

Programmer
Jul 2, 2001
49
US
I have a form with numerous fields, some of which when selected cause other form fields to appear. When the page relods it goes back to the top of the form. Does anyone know of a way to force it to focus on the field that was last selected? I've tried numerous things and can't seem to get it to work properly.

 
are you doing this is straight HTML or do you have another scripting language (i.e. PHP / ASP) running along side of it?

What are you using to re-load the page?

Can you provide some of your code, would make it easier to just add a few things to get it working for you, rather than trying to guess how you have it working so far :)



--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
This is the code for the page reload:

function refreshwindow1(){
var form = document.forms[0];
var pageurl = "<%=Request.ServerVariables("URL")%>";
var servername = "<%=Request.ServerVariables("SERVER_NAME")%>";
var sitepath = "<%=Request.ServerVariables("PATH_INFO")%>";
var query = "<%=Request.ServerVariables("QUERY_STRING")%>";
var ModelSeries = "<%=request.QueryString("ModelSeries")%>";
var Effectivity = "<%=request.QueryString("Effectivity")%>";
var cert_plan = "<%=request.QueryString("cert_plan")%>";
var cert_phases = "<%=request.QueryString("cert_phases")%>";
var master_cert = "<%=request.QueryString("master_cert")%>";

for (var i = 0; i < form.master_cert.length; i++){
if (form.master_cert.options.selected){
var master_certTemp = form.master_cert.options.value;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top