Thursday, January 28, 2010

Difference between Model Validation and manually setting error option in a form element

I noticed a strange behaviour today.

I tried to enter some manual validation into a form.
This worked fine, except that the error message was printed out before
the input element:

<div id="Article.journal_idMessage" class="error">Please select or
enter a Journal</div><div class="input select"> [...]

When I use the Model Validation, the Error Message is appended after
the form element (and with different HTML Code):
<div class="input text error"><input name="data[Publication][year]"
type="text" size="4" value="2050" id="PublicationYear" class="form-
error" /><div class="error-message">Please enter a year between 1000
and 2030</div></div>


Is there a way to tweak the error field in the form to act like the
normal model validation?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: