Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Form mapping based on ActionErrors etc?

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anyone know of any struts tags or technique to automatically highlight or change font colro or focus a form tag based on the input of a ActionErrors object?
For example, if I have an text box named �foo� and my ActionError object returns an identifier �foo� I know want to highlight that field e.g. paint it red, place the cursor there etc?

Any ideas?

thanks
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could create javascript init() method and call it from the body's onload event. In that method, put something like the following:

<logic:messagesPresent property="foo">
document.myForm.foo.style.color = 'red';
document.myForm.foo.focus();
</logic:messagesPresent>
[ August 04, 2005: Message edited by: Merrill Higginson ]
 
Max Tomlinson
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perfect-

thanks, Merrill-

Max
 
    Bookmark Topic Watch Topic
  • New Topic