DEVFYI - Developer Resource - FYI

Why doesn't the focus feature on the <html:form> tag work in every circumstance?

Struts Questions and Answers


(Continued from previous question...)

45. Why doesn't the focus feature on the <html:form> tag work in every circumstance?

Unfortunately, there is some disagreement between the various browsers, and different versions of the same browser, as to how the focus can be set. The <html:form> tag provides a quick and easy JavaScript that will set the focus on a form for most versions of most browsers. If this feature doesn't work for you, then you should set the focus using your own JavaScript. The focus feature is a convenient "value-add" -- not a core requirement of the tag. If you do come up with a JavaScript that provides the final solution to this project, please post your patch to this Bugzilla ticket.

(Continued on next question...)

Other Interview Questions