arravalli12
Programmer
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
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