<br><br><div class="gmail_quote">On Wed, Jan 6, 2010 at 3:29 PM, Michael Friedman <span dir="ltr">&lt;<a href="mailto:friedman@highwire.stanford.edu">friedman@highwire.stanford.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Maybe it&#39;s my lack of front-end-web-rendering experience showing, but what kind of form validation are you doing?<br>
<br>
My office generally designs forms so that fields either don&#39;t need validation (a list of state abbreviations instead of a text box; a Javascript date picker) or are validated by Javascript (checking email address formatting or credit card number formatting). That way the user gets immediate feedback and doesn&#39;t have to send the form to the server for validation. For things like full text search fields, we just throw the query at the full text search server and let it figure it out.<br>


<br>
I guess I don&#39;t understand why &quot;form validation&quot; is something you&#39;d want a special perl module for.<br></blockquote><div><br>In addition to what others have said about the importance of server side validation, a form is typically made up of a collection of data -- and the validation of it also depends on what&#39;s in the form itself.   So, for me, I encapsulate that into a form object.<br>

<br>It&#39;s a black box that works in two directions.  One direction is taking user data (often in an HTML form, but could be anything), validate the input, and then if validated save to the data store.  The other direction does the opposite and takes values from a store and creates the external representation.  The simple example would be a DateTime object internally and a set of values for year, month, day externally.  A more complex form might write to different database tables based on what input the form receives. <br>

<br>Then in MVC the controller&#39;s job ends up being the traffic, eh, controller.  Request comes in and is passed to the form object and if validated and successful redirect to the success page, if does not validate then show the form with errors.<br>

<br>At least that&#39;s how I think of it...<br></div><div><br> </div></div><br clear="all"><br>-- <br>Bill Moseley<br><a href="mailto:moseley@hank.org">moseley@hank.org</a><br>