struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dimitris Mouchritsas <>
Subject Javascript validation error
Date Tue, 15 Jul 2008 15:02:15 GMT
Hi all,
I'm trying to use javascript validation with validator, as well as 
server side validation.
Server side validation works just great. But when I try to use client 
side validation I
get a validateRequired not found error.

This is my jsp:
    <html:javascript formName="LoginForm" />
    <html:form action="/login" onsubmit="return validateLoginForm(this)">
and this is the result produced from the tags:


        <script type="text/javascript"> 

    var bCancel = false; 

    function validateLoginForm(form) { 
        if (bCancel) { 
            return true; 
        } else { 
            var formValidationResult; 
            formValidationResult = validateRequired(form); 
            return (formValidationResult == 1); 

    function LoginForm_required () { 
     this.a0 = new Array("username", "Username is required.", new Function ("varName", " return
     this.a1 = new Array("password", "Password is required.", new Function ("varName", " return


<form id="LoginForm" method="post" action="/ceproc/" onsubmit="return validateLoginForm(this)">

Now I understand why the error happens, but where do I locate this 
validateRequired function? How do I include it in my jsp?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message