This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Struts and the fly likes limit the width of error message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "limit the width of error message" Watch "limit the width of error message" New topic
Author

limit the width of error message

Armin Vetek
Greenhorn

Joined: Aug 21, 2010
Posts: 29
Hi,

I put two textfields on the struts2 form. I am using qxhtml theme - this is a custom theme, you could check vitavara.com. It is similar to xhtml.

The form looks like below when I start to input the data:


I leave the value in textfield1 empty and I click the submit button. I get an error that textfield1 should not be empty. Label2 and textfield2 move right because error message belonging to textfield1 is displayed in one row and the length of errormessage in bigger then textfield1, also the textfield1 width increase. The form looks like below after the submit button is pressed:


I would like to fix the width of error message like below.



Is it possible to fix the errormessage width?

I think I should modify the row in controlheader-core.ftl:
<span class="errorMessage">${error?html}</span><#t/>

If I manually modify the row like in the example below, then it works. But I would like to get a dynamic width of textfield not fixed to 100px like in te statement below.
<span class="errorMessage" style="display: inline; width: 100px">${error?html}</span><#t/>

Best regards,
javanus


http://www.javanus.com/blogs
 
Don't get me started about those stupid light bulbs.
 
subject: limit the width of error message