• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
reply
    Bookmark Topic Watch Topic
  • New Topic