You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by joel <jo...@displayware.com> on 2006/07/11 23:10:47 UTC

CForms: Ajax-based widget validation?

When using an Ajax-enabled form, is there a way to specify in the model that
each widget should be validated as the user leaves the field and to use Ajax
to display the results without refreshing the entire page?  Thanks.

joel




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


Re: CForms: Ajax-based widget validation?

Posted by Simone Gianni <s....@thebug.it>.
Hi Joel,
AFAIK no, there is no way to specify that the widget must be validated
when the users leaves the widget. Validation is an operation performed
after the submit because each single validation could be dependent by
other fields values, for example you could write:

<fd:field id="computersInTheOffice">
 ....
</fd:field>
<fd:field id="runningLinux">
  ...
  <fd:validation>
    <fd:range min="0" max="computersInTheOffice"/>
  </fd:validation>
</fd:field>

Anyway, when using Ajax, the page is not reloaded : when you click the
submit button, an Ajax request is sent to cocoon, validation is
performed, and if there are any errors the page is updated in ajax mode,
without reloading, while if there are no errors Ajax "continues" the
execution reloading the page as instructed by the flow.

Hope this helps,
Simone

joel wrote:

>When using an Ajax-enabled form, is there a way to specify in the model that
>each widget should be validated as the user leaves the field and to use Ajax
>to display the results without refreshing the entire page?  Thanks.
>
>joel
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>
-- 
Simone Gianni

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