W3C home > Mailing lists > Public > www-forms@w3.org > October 2005

Re: Fw: Disabling a button based on validity

From: <andyh@collegenet.com>
Date: Thu, 27 Oct 2005 16:16:57 -0700
To: Erik Bruchez <erik@bruchez.org>
Cc: www-forms@w3.org, www-forms-request@w3.org
Message-ID: <OFDAD5B103.D743B900-ON882570A7.007E659A-882570A7.007FD982@collegenet.com>

Well yeah probably with sizable forms, my forms are fairly small at the
moment :-)

However the technique I outlined is straightforward and should work on all
Agreed it can be improved, and now that I've had a bit of time to tinker I
have an improvement for all the fPer's out there.

The latest version of fP (1.3.8) introduced an extension function to return
the validity of a node. So I can now reduce the error counting to a single
calculate and no per control actions.

<xf:instance id="iErrors">
      <errors xmlns="">

<xf:bind nodeset="instance('iErrors')/count"
calculate="count(instance('iUser')//*[fpext:valid(.) = 0])"/>
<xf:bind id="bndSave" nodeset="instance('iErrors')/save" relevant="../count
= 0" />
<xf:bind id="bndNoSave" nodeset="instance('iErrors')/nosave"
relevant="../count &gt; 0" />


             Erik Bruchez                                                  
             >                                                          To 
             Sent by:                  www-forms@w3.org                    
             www-forms-request                                          cc 
             @w3.org                   www-forms@w3.org                    
                                       Re: Fw: Disabling a button based on 
             10/27/2005 02:08          validity                            

andyh@collegenet.com wrote:

> The code I presented below is not that cumbersome. Once you have the
> instance and the three binds, you need a single instance data element per
> field and two simple event handlers per control.

You are kidding, right? It is EXTREMELY cumbersome. Again, this is
functionality that you want in pretty much every XForms page. It should
be achievable with an attribute or two.

Received on Thursday, 27 October 2005 23:17:06 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:36:16 UTC