File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to use focus attribute of html:form tag for an array of textboxes

 
Amith Mahalingaiah
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
In a jsp, i have a form which has an array of textboxes called "routerName".

my form tag looks like this.......

<html:form action="/AffiliateSave" method="post" focus="routerName">

|_________|
|_________|
|_________|
|_________|
|_________|
|_________|
|_________|

i have an array of textboxes as shown above. When the jsp is served, i want the focus to be on the first textbox.

i tried giving focus="routerName"........then i got a javascript error which said "Object doesn't support this property or method"

then i tried giving focus="routerName[0]"........then i got a javascript error which said "focusControl.type is null or not an object".

i think the second option is correct but i am missing something.

Any info on this regard would be appreciated.

Thanks
Amith
 
Anthony Watson
Ranch Hand
Posts: 327
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure that you have an ActionForm with the routerName property and its getter/setter methods. Also make sure the form is configured in the struts config file properly. Finally, you should be using struts tags to create the text boxes.

You should not need the index number after focus="routerName".
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic