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!

Html Form Focus

Status
Not open for further replies.

james777

Programmer
Jul 9, 2000
41
US
Hello All,
I am having trouble getting the field focus in HTML .
What i need :
When a user comes to form ,the focus is set to Field1.
and next to it is a button to do search ,which does a search action( when user clicks) and fills up the field2, field3, field4 and field5. When user clicks the search the focus should go to field6, which is an input field, only when field1 value is found in database. Is there a way to do it.

Thanks
Jim..
 
Hi,

JavaScript is the only solution. On the HTML FORM onload call the javascript fuction to set the focus on field1. When user clicks on the search add a javascript function to check that field1 is not empty and sift the foucs to field6.

Cheers
Venu
 
Hi Venu,
Thank you for your suggestion.
How would i do that, can you send a piece of code. I tried , but unsuccessful.

How would i check the value form bean property from jsp function?. I have db call in action class which sets a setter (setRecordFound). If you have some example that would be much helpful.

Thanks
Jim..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top