AllExperts > Experts 
Search      

Active Server Pages Programming (ASP)

Volunteer
Answers to thousands of questions
 Home · More Questions · Answer Library  · Encyclopedia ·
More Active Server Pages Programming (ASP) Answers
Question Library

Ask a question about Active Server Pages Programming (ASP)
Volunteer
Experts of the Month
Expert Login

Awards

About Us
Tell friends
Link to Us
Disclaimer

 
 
 
 
About Jeff Allen
Expertise
I can answer basic to intermediate questions related to Classic ASP.I can answer Intermediate to Advanced questions CSS& HTML, and basic questions about JavaScript and Ajax. I can also answer questions related to web page accessibility under US Section 508.

Experience
I have 8 years experience with HTML. I have been developing in ASP, VBScript and CSS for two years each. I also currently work as web developer.

Organizations
IWA-HWG

Education/Credentials
I have a BA in English with minors in Web Design and Scientific and Technical Writing

 
   

You are here:  Experts > Computing/Technology > Business Software > Active Server Pages Programming (ASP) > Form cursor

Topic: Active Server Pages Programming (ASP)



Expert: Jeff Allen
Date: 9/26/2006
Subject: Form cursor

Question
Jeff,
I've created several forms with multiple text boxes in each for input.  User currently has to click in first text box to activate cursor; after filling in that box, Enter will move cursor to next box.  Is there some way to have the first text box be active, i.e., have the cursor positioned there, when the form opens?

Thanks for any info you may provide.

-Tom

Answer
Why not just do this with JavaScript like so:

Given that you have a form, and in that form you have a textbox named fname the following will set focus to that element

<html>
<head>
<title></title>
</head>
<body onload="document.form.fname.focus()">
<form method="post" action="somepage.asp">
<label for="fname">First Name: </label><input type="text" name="fname" id="fname" value="" />
<label for="lname">Last Name: </label><input type="text" name="lname" id="lname" value="" />
<label for="addr">Address: </label><input type="text" name="addr" id="addr" value="" />
....
</form>
</body>
</html>

Add to this Answer    Ask a Question



  Rate this Answer
   Was this answer helpful?
Not at allDefinitely              
   12345  

     
About Us | Advertise on This Site | User Agreement | Privacy Policy | Help
Copyright  © 2008 About, Inc. About and About.com are registered trademarks of About, Inc. The About logo is a trademark of About, Inc. All rights reserved.