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!

Like to focus on a particular field.

Status
Not open for further replies.

rampage60

IS-IT--Management
Jul 1, 2002
73
NO
When I use this string in a if statment "document.expense.name.focus()" I get this error:

"Object doesn't support this property or method"

What is the correct string to focus on a particular field?

 
the problem may be this:
expense.name

any field.name will give u the name of the field as in:
<input type=&quot;text&quot; name&quot;asd&quot;>

alert(document.expense.asd.name) //gives asd

so avoid using name try changing the field name to name1
and do this:
document.expense.name1.focus



Known is handfull, Unknown is worldfull
 
Thanks,

I just notice the field name is not &quot;name&quot; but &quot;yourname&quot; .
My bad... : )
 
so:
document.expense.yourname.focus() is not working? can u post the code?

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top