I added some things to testBOOKSListAutoUpdate.jsp:

<%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
<html>
        <head>
                <db:base/>
        </head>
        <body>
                <db:dbform 
                        multipart="false" 
                        autoUpdate="true" 
                        followUp="/tests/testBOOKSListAutoUpdate.jsp" 
                        javascriptValidation="true"
                        formValidatorName="book"
                        maxRows="*" tableName="BOOK">
                        <db:header>
                                <db:errors/>  
                                <table>
                        </db:header>
                        <db:body allowNew="true">
                                <tr>
                                        <td><db:dataLabel 
fieldName="BOOK_ID"/>&nbsp;</td>
                                        <td><db:textField 
fieldName="ISBN"/>&nbsp;</td>
                                        <td><db:textField 
fieldName="AUTHOR_ID"/>&nbsp;</td>
                                        <td><db:textField 
fieldName="TITLE"/>&nbsp;</td>
                                        <td>
                                                <db:deleteButton 
style="width:55" caption="Delete" confirmMessage="Really?"/>
                                        </td>
                                </tr>
                        </db:body>
                        <db:footer>
                                <tr>
                                        <td><db:textField hidden="true" 
fieldName="BOOK_ID"/>&nbsp;</td>
                                        <td><db:textField 
fieldName="ISBN"/>&nbsp;</td>
                                        <td><db:textField 
fieldName="AUTHOR_ID"/>&nbsp;</td>
                                        <td><db:textField 
fieldName="TITLE"/>&nbsp;</td>
                                        <td>                                    
                        
                                                <db:insertButton 
showAlways="true" caption="Add New"/>
                                        </td>
                                </tr>
                                <tr>
                                        <td colspan="4" align="center">
                                                <db:updateButton 
caption="update" />
                                        </td>
                                </tr>
                                </table>
                        </db:footer>
                </db:dbform>

<%@ include file="httpSnooper.jsp" %>

</body>
</html>    

And added this to validation.xml:

     <form name="book">

         <field    property="TITLE" depends="required">
                                <msg name="required" key="field name required"  
resource="false"/>
             </field>
      </form>


This does js validation on Update, but not on Add New or Delete.

On Add or Delete, the operation is performed and then updates are attempted. 
There is server-side validation, but the error messages are just displayed at 
the top with no clue on where the errors come from.

Is there a way to have validation done in js on the client for all cases?

Thanks,
Steve




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
DbForms Mailing List

http://www.wap-force.net/dbforms

Reply via email to