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

changing button focus

Status
Not open for further replies.

chaddu1256

IS-IT--Management
Jan 13, 2003
28
0
0
US
Right now I have a webpage that servers as a login page for our system. It has a Username and Password text box, then 5 buttons, a login, password hint, password recovery, get started, and FAQ. When you enter the URL for the page and it first comes up there is a cursor in the Username textbox but the button focus is on get started. In other words you enter the username and password and when you hit enter it selects the get started button rather than the login button. My question is how do I set which button the default focus is on?
 
make sure that both buttons are not "Submit" buttons or it will trigger the first one encountered.


buffalo.gif height="65" width="35"

 
how are your <input type="buttom" or "submit"> entries? could you post the piece of code?

may be you will need javascript.
 
Ok here we go:

For the login button I have
<input type="button" value="Login" name="Login" onClick="set()">

For Password hint
<input type="button" value="Password Hint" name="PassHint" style="width:110px" onClick="showHint()">

For request new password
<input type="button" value="Click Here" name="ReqPass" style="width:110px" onClick="newPassword()">

For get started
<input name="Submit" type="submit" onClick="MM_goToURL('parent','../BXSignUpServlet?billerid=ChangeMe&country=US&language=en');return document.MM_returnValue" value="Get Started">

For FAQ
<input name="Submit2" type="submit" onClick="MM_goToURL('parent','faq.html');return document.MM_returnValue" value="Frequently Asked Questions">

If necessary I can open up the page to outside so you guys can see the source.
 
Your login and password buttons should have

Code:
<input [b]type="submit"[/b] value="Send me your 
name!">
and not type="button"


buffalo.gif height="65" width="35"

 
Ok, here is your problem:


For the login button I have
<input type="button" value="Login" name="Login" onClick="set()">

For get started
<input name="Submit" type="submit" onClick="MM_goToURL('parent','../BXSignUpServlet?billerid=ChangeMe&country=US&language=en');return document.MM_returnValue" value="Get Started">

the "login" button must have type="submit"
the "get started" button must have type="button"
 
Ok once again thanx alot I got it working now.
 
chaddu1256, get in the habbit of closing your posts 13 posts and no closing ones.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top