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

Reset button

Status
Not open for further replies.

arravalli12

Programmer
May 3, 2005
62
US
I have a text box and update button and reset button.
I have a function set focus():
function setFocus()
{
FamilyCode2_update.txt1.focus();
FamilyCode2_update.txt1.select()
}.
On load, I call this function and focus is on text box and selects the text.
When I hit enter button, it clicks update button and displays record updated message or error message if any.
After entering some number in the text box, if I click reset button - it resets that to original value and focus remains on reset button.
In this situation user hits the enter button - nothing happens becos focus is on Reset button.
I called set focus() on click in reset button. The problem is now focus instead of going to text box it's going to update button. I want the focus to be on text box. Can any one help me?
<input name="Reset" type="Reset" value="Reset" onclick="setFocus();">
Let me know.
Thanks
 
This isn't really an ASP question because it doesn't involve server-side script.

If you don't get a good tip in this forum you might want to try the JavaScript forum: forum216

The people on that other forum probably have more experiece with client-side issues like this.
 
i think you need to use onBlur event to reset the focus...as Sheco mentioned, JavaScript forum is the best place to ask this question...

-DNG
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top