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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab order problem 1

Status
Not open for further replies.

aharrisreid

Programmer
Nov 17, 2000
312
GB

I have a number of HTML input boxes on a web-page, with their tab-order determined by a tabindex clause for each input box.

a) When the page is first displayed, it is not clear which text box is first in tab order. How can I ensure that when page is first displayed, the 'i-bar' cursor is shown flashing in the first input box?

b) The page has a selection option list as the 3rd object in tab order, but if there is a pre-selected item in the list, the list becomes the first-highlighted object. Assuming I want a preselected option in the list, once again, how can I ensure that textbox 1 is the first to receive focus.

I would prefer a HTML-only solution, but failing that a JavaScript solution will do.

Any help would be appreciated.

Alan Harris-Reid
 
place this just above the closing body tag </body> or the closing form tag </form>
fill in appropriate names
<script langauge=&quot;javascript&quot;>
document.formname.fieldname.focus();
</script> _______________________________________________
{ str = &quot;sleep is good for you. sleep gives you the energy you need to function&quot;;
ptr = /sleep/gi;Nstr = str.replace(ptr,&quot;coffee&quot;);alert(Nstr); }

_______________________________________________
for the best results to your questions: FAQ333-2924
has you're questio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top