You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jeffrey Ford <jf...@fgm.com> on 2004/10/26 18:52:26 UTC

client-side validation javascript error

Hi,

I'm trying to get client-side validation to work using Struts, v. 1.2.2.
More specifically, I'm receiving a javascript error while trying to use the
'required' validation rule.  The error in IE says:

Error: 'required' is undefined

When I look at the generated javascript, this is indeed true.  However,
there's a function called 'locationForm_required' where 'locationForm' is
the name of my form.  It seems that the 'validateRequired' method should be
calling a 'new locationForm_required( )' instead of a 'new required( ).

function locationForm_required () {
     this.a0 = new Array("shortDescription", "Short Description is
required.", new Function ("varName", " return this[varName];"));
}

function validateRequired(form) {
        var isValid = true;
        var focusField = null;
        var i = 0;
        var fields = new Array();
        oRequired = new required();
        for (x in oRequired) {
            var field = form[oRequired[x][0]];
... <blah> <blah>


Does anyone have any insight into this?

Thanks in advance,
Jeff




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: client-side validation javascript error

Posted by Niall Pemberton <ni...@blueyonder.co.uk>.
Version 1.2.2 of Struts was withdrawn because of problems. The current "ga"
quality release of Struts is Version 1.2.4

http://struts.apache.org/acquiring.html

Niall

----- Original Message ----- 
From: "Jeffrey Ford" <jf...@fgm.com>
To: <us...@struts.apache.org>
Sent: Tuesday, October 26, 2004 5:52 PM
Subject: client-side validation javascript error


> Hi,
>
> I'm trying to get client-side validation to work using Struts, v. 1.2.2.
> More specifically, I'm receiving a javascript error while trying to use
the
> 'required' validation rule.  The error in IE says:
>
> Error: 'required' is undefined
>
> When I look at the generated javascript, this is indeed true.  However,
> there's a function called 'locationForm_required' where 'locationForm' is
> the name of my form.  It seems that the 'validateRequired' method should
be
> calling a 'new locationForm_required( )' instead of a 'new required( ).
>
> function locationForm_required () {
>      this.a0 = new Array("shortDescription", "Short Description is
> required.", new Function ("varName", " return this[varName];"));
> }
>
> function validateRequired(form) {
>         var isValid = true;
>         var focusField = null;
>         var i = 0;
>         var fields = new Array();
>         oRequired = new required();
>         for (x in oRequired) {
>             var field = form[oRequired[x][0]];
> ... <blah> <blah>
>
>
> Does anyone have any insight into this?
>
> Thanks in advance,
> Jeff
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org