cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos M. S. Bento Nogueira" <cm...@student.dei.uc.pt>
Subject Re: CForms: Validation based on values from several widgets
Date Wed, 29 Jun 2005 15:16:54 GMT
Hi Armaz!
Check the cforms "various actions" sample on cocoon\samples\blocks\forms.

You can use javascript to achieve the efect, something like this:

<fd:on-value-changed>
<javascript>
var current_widget_value = event.source.value;

var myFirstWidget = event.source.parent.lookupWidget("myFirstWidget");
var mySecondWidget = event.source.parent.lookupWidget("mySecondWidget");

             if (mySecondWidget.value == myFirstWidget.value)
             {
  		do_something_here();
             }
</javascript>
</fd:on-value-changed>

Greets,
CarlosN.


On Wed, 29 Jun 2005, Armaz Mellati wrote:

> Hi
>
>
>
> What is the best way of validating based on the values of several widgets in a CForm
? I mean somthing like this:
>
> If (model.foo == 'something') && (model.bar == null) {
> 	return false;
> }else{
> 	return true ;
> }
>
>
> Where should I do or can I do such a validation ?
>
> Any idea ??
>
> Regards,
> Armaz
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

-- 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message