Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

limit the width of error message  RSS feed

Armin Vetek
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I put two textfields on the struts2 form. I am using qxhtml theme - this is a custom theme, you could check 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,
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!