0 Replies Latest reply on Nov 8, 2007 2:41 PM by sansaric

    Client side validation

    sansaric

      I need to use client side validation in my project because I am using a fileUpload component and server validation clears the content of this field if there is a validation error. Trinidad offers client side validation, however, based on the incompatibilities I have read about with RichFaces AJAX subsystem, I decided to look further. I tried the Client side validation system available in the MyFaces Tomahawk sandbox and all RichFaces AJAX functionality stops working when I enable it. I am left with writing my own javascript validation in Javascript and calling it with an onsubmit event in the form tag (<h:form id="MyForm" enctype="multipart/form-data" onsubmit="return validateForm(this);">). Even if I return false inside the javascript validation function if validation fails, the trip to the server still takes places along with server side validation.

      Is there a way to call client side javascript for validation while using RichFaces components and prevent the trip to the server if the javascript function returns false as called above in the form tag ?

      thanks in advance for your help,

      Marcel