http://docs.model-glue.com/wiki/QuickStart/5:ValidatingaForm


While going through the steps of the quickstart I found that the
following is not correct

---------------------------------------------------------
<cfset event.copyToScope( variables,
"xe_translate,phrase,phraseError" ) />
<cfset submit = event.linkTo( xe_translate ) />

<cfform action="#submit#">
    <cfinput type="text" name="phrase" required="false"
value="#phrase#" />
    <input type="submit" value="Ok" />

    <cfif event.exists("phraseError")>
        <cfoutput><p style="color: red;">#phraseError#</p></
cfoutput>
    </cfif>
</cfform>
---------------------------------------------------------

By using copyToScope() wouldn't we create the "variables.phraseError"
every time? it may have a blank value but it exists in the "variables"
scope.

so the <cfif event.exists("phraseError") > should be changed to
something other than checking the existence of the "phraseError".
Maybe the length of it would do the trick?

We already know "variables.phraseError" will exist in the "variables"
scope whether with a value from the controller or with blank from the
initialization of it by using copyToScope().

could somebody change that conditional to  <cfif
len(variables.phraseError) neq 0 > ?

This may help new developers going through the steps in the tutorials.

Fernando

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to