cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Larsen" <gary.lar...@envisn.com>
Subject RE: CForms 2.1 javascript validation not working
Date Sat, 18 Jul 2009 13:01:17 GMT
Hi Barbara,

 

I finally had a closer look at this.  With your help I figured out that not
only is returning false necessary but setValidationError() is also.

 

Thanks so much!

 

gary

 

  _____  

From: Barbara Slupik [mailto:barbara_slupik@wro.vectranet.pl] 
Sent: Sunday, July 12, 2009 11:23 AM
To: users@cocoon.apache.org
Subject: Re: CForms 2.1 javascript validation not working

 

Hello

 

I use cocoon-2.2.0 and do my validation like this:

 

<fd:validation>

          <fd:javascript>

                      var success=true;

                      if (some-test) {widget.setValidationError(new
Packages.org.apache.cocoon.forms.validation.ValidationError("my-error",true)
); success=false;}

                      return success;

          </fd:javascript>

</fd:validation>

 

and in my flow I have:

 

form.load(my-data);

form.showForm("my-form");

if (form.isValid) {

          form.save(my-data);

          ...

}

 

Barbara

 

On 11 Jul, 2009, at 2:42 pm, Gary Larsen wrote:





Hi,

 

For some reason javascript validation stopped working on all forms (2.1.9):

 

          <fd:validation>

            <fd:javascript>

              cocoon.log.error("test validation: return false");

              return false;

            </fd:javascript>

         </fd:validation>

 

The validation is fired on a submit widget yet the form is still being
submitted.  Would anyone have an idea what may be wrong?

 

Thanks for any suggestions!  I'm stumped right now.

gary

 


Mime
View raw message