Rick,

>There's no reason to use <noscript>. Server-side errors should/will only
>occur when the client has already tried filling out the form and something
>failed and you need to display them a message.
>
>So, there's no reason to even display a message unless there was a failure
>caught by the server. Regardless of whether or not JS was enabled, you need
>to display the message to the user.

Here's an example of exactly what I'm talking about:
http://www.pengoworks.com/workshop/jquery_demo/ex2.3_mailing_list_validation
..cfm

(Watch line wrapping.)

And here's what the CF code looks like:
<div id="formContent">
  <div id="errorMessage">
    <cfif structKeyExists(variables, "stAction") and NOT stAction.success>
       <!---//
         generate the error in a label tag, this will allow clicking of the
         error to take you to the form field. this is also the syntax used
         by the jQuery Form Validation tool, so any error in the label will
         be dynamically replaced by the Form Validation tool
       //--->
       <label style="display: inline;" class="error" 
         generated="true" for="email">
         <cfoutput>#stAction.message#</cfoutput>
       </label>
     </cfif>
  </div>

  <label for="email">
    E-mail Address:
  </label>

  <input type="text" name="email" id="email" />
  <input type="submit" value="Sign Up" />
</div>

Try running the page w/JS enabled. Try just submitting the form and then
enter some data that's not an e-mail address. 

If you notice, the error messages will display w/out the URL ever
changing--this is because the validation is being done on the client-side. 

Now if you disable JS and reload the page and repeat the process, you'll
notice the URL changes. This is because the validation occurs at the server.
All I'm doing is re-displaying the page but outputting an errors the server
may have generated.

You can view the source code to view the client-side validation. About 90%
of the code for doing the client-side validation is just comments explaining
what's going on.

-Dan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Deploy Web Applications Quickly across the enterprise with ColdFusion MX7 & 
Flex 2
Free Trial 
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJU

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:275633
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to