Announcement Announcement Module
Collapse
No announcement yet.
ideas on displaying validation errors Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ideas on displaying validation errors

    I am trying to display a web form with validation on submit, but am having a hard time displaying errors in a neat way. Currently, I am doing it the "spring" way:
    Code:
    <spring&#58;bind path="myCommand.description">
    	<input type="text" name="$&#123;status.expression&#125;" value="<c&#58;out value="$&#123;status.value&#125;"/>"/>
    	<span class="fieldError">$&#123;status.errorMessage&#125;</span>
    </spring&#58;bind>
    the problem occurs when I have multiple inputs on one line, when the validation errors come up, the fields get wrapped to the next line... ahhh

    how has anyone dealt with this?

  • #2
    Hint : you can bind the same property more than once. So this is valid:-

    Code:
    <spring&#58;bind path="myCommand.description">
        <input type="text" name="$&#123;status.expression&#125;" value="<c&#58;out value="$&#123;status.value&#125;"/>"/>
    </spring&#58;bind>
    
    <spring&#58;bind path="myCommand.description">
        <span class="fieldError">$&#123;status.errorMessage&#125;</span>
    </spring&#58;bind>
    You can then put the error anywhere you want on the page. As to how you design your page, well that's up to you :wink:

    Bob

    Comment

    Working...
    X