Tuesday, 6 August 2013

global form:errors field sequence

global form:errors field sequence

At the beginning of my form, I have a global form:errors :
<form:form method="post" action="updateMainContact"
modelAttribute="mainContact">
<form:errors path="*" cssClass="errorblock" element="div" />
In my form, I have three fields in this specific order : Phone, Cell, Fax :
<th><label for="mainContactPhoneLabel">Phone
Number:<br>9999999999</label></th>
<td><form:input path="phone" type="integer" size="10" maxlength="10" />
<th><label for="mainContactFaxLabel">Fax:<br>9999999999</label></th>
<td><form:input path="fax" type="integer" size="15" maxlength="15" />
<th><label for="mainContactEmailLabel">Email:</label></th>
<td><form:input path="email" type="text" size="30" maxlength="30" /></td>
When I force a typemismatch error all three fields, the result sequence is
ALWAYS Cell, Fax then Phone. Why is that ? How can I make the order follow
my field sequence on the screen (Phone, Cell, Fax) ?
Note that I cannot have individual form:errors tags because I do not have
enough space peer field to put the form:errors tag, which is why I have
them all on top.

No comments:

Post a Comment