Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
Spring modules Client Side validation Issues Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring modules Client Side validation Issues

    Hi, I was wondering if anyone has a solution/example for configuring the spring modules commons validation on the client?

    I am using spring-modules v0.9 and Spring 2.5.5, and have successfully got the server side validation working. I have also looked at the samples with the download and I'm a little confused comparing the example with the documentation.

    Here is my jsp

    Code:
    <script type="text/javascript" src="<c:url value="/validator.js"/>"></script>
    
    
    <validator:javascript formName="lightRegistration"
       staticJavascript="false" xhtml="true" cdata="false"/>
    
    
    
    
    
    <form htmlEscape="true" name="lightRegistration" method="post" onsubmit="return validateLightRegistration(this)">
        <table>
    
            <tr>
                <td><spring:message code="lightRegistrationEmail"/></td>
                <td>
                    <spring:bind path="lightRegistration.email">
                        <input type="text" name="email"  value="<c:out value="${status.value}"/>" size="15" maxlength="60"/>
                        <font color="red"><c:out value="${status.errorMessage}"/></font>
                    </spring:bind>
                </td>
            </tr>
            <tr>
                <td><spring:message code="lightRegistrationPassword"/></td>
                <td>
                    <spring:bind path="lightRegistration.password">
                        <input type="password" name="password" value="<c:out value="${status.value}"/>" size="15" maxlength="60"/>
                        <font color="red"><c:out value="${status.errorMessage}"/></font>
                    </spring:bind>
                </td>
            </tr>
            <tr>
                <td><spring:message code="lightRegistrationVerifyPassword"/></td>
                <td>
                    <spring:bind path="lightRegistration.verifyPassword">
                        <input type="password" name="verifyPassword" value="<c:out value="${status.value}"/>" size="15" maxlength="60"/>
                        <font color="red"><c:out value="${status.errorMessage}"/></font>
                    </spring:bind>
                </td>
            </tr>
    
        </table>
    
        <br/>
    
        <input type="submit" value="<spring:message code="formSubmit"/>"/>
    
    </form>
    Do I need the validator.js? As I don't understand what's it's used for, I have copied the example in the download and created a mapping in web.xml as well as adding the controller and view resolver to the validator.jsp, but it still doesn't validate with the javascript.

    There is also no mention of the config in the documentation, so if anyone has successfully implemented this, please can you post your solution.

    Thanks

  • #2
    Hi JamesHoare ,

    If you find the solution for Client side validation , Please Let Me Know

    Thanks
    AVR

    Comment

    Working...
    X