You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Aron Shamash <Ar...@dna.co.uk> on 2006/02/27 17:52:30 UTC

Finding length of widget of datatype="string"

Hi

Up until now I have always validated length of string widget using
<fd:length> eg:

                <fd:length min="4" max="60">
 
<fd:failmessage><i18n:text>slb.addressOneSecondApplicant.length</i18n:te
xt></fd:failmessage>
                </fd:length>  

In this (new) case I only want this validation to be executed depending
on the value of another widget therefore I wanted to use server-side
javascript to find the widget's length. 

This does not appear to be working for me though. 

widget.length is undefined. 

Is this possible? Is there another way around this problem?

 

 

 

 

 

 

Aron Shamash

Interface Developer

 

Phone 020 7907 4545

DNA An Avenue A | Razorfish Company

www.dna.co.uk

 

Re: Finding length of widget of datatype="string"

Posted by Simone Gianni <s....@thebug.it>.
Hi Aron,
yes, AFAIK there is no widget.length, you should use 
widget.getValue().length() in java, maybe widget.getValue().length or 
widget.value.length in javascript.

Hope this helps,
Simone


Aron Shamash wrote:

> Hi
>
> Up until now I have always validated length of string widget using  
> <fd:length> eg:
>
>                 <fd:length min="4" max="60">
>                     
> <fd:failmessage><i18n:text>slb.addressOneSecondApplicant.length</i18n:text></fd:failmessage>
>                 </fd:length> 
>
> In this (new) case I only want this validation to be executed 
> depending on the value of another widget therefore I wanted to use 
> server-side javascript to find the widget's length.
>
> This does not appear to be working for me though.
>
> widget.length is undefined.
>
> Is this possible? Is there another way around this problem?
>
>  
>
>  
>
>  
>
>  
>
>  
>
>  
>
> Aron Shamash
>
> Interface Developer
>
>  
>
> Phone 020 7907 4545
>
> *DNA *An Avenue A | Razorfish Company
>
> _www.dna.co.uk_
>
>  

-- 
Simone Gianni