W3C home > Mailing lists > Public > www-forms@w3.org > January 2002

how to make relevant only when valueChanged?

From: Alistair Coles <anc@hplb.hpl.hp.com>
Date: Mon, 28 Jan 2002 16:20:43 +0000
Message-ID: <3C557A5B.5366D971@hplb.hpl.hp.com>
To: www-forms@w3.org
Suppose I have a form that collects an 8 OR 9 digit account number,
and if the account number is 8 digits displays some other form
controls that are not relevant if the account number is 9 digits. I
guess I can use a constraint of the form:

<xforms:model>
  <xforms:instance>
    <account/>
    <eightOnlyData/>
  </xforms:instance>
  <bind ref="eightOnlyData" relevant = "string-length(account)=8"/>
</xforms:model>

As a user enters the account number, each valueChanging event will
cause the relevant constraint to be checked, so that the form controls
bound to eightOnlyData will become (momentarily) visible even for a
user entering a 9 digit account number. Is it possible to construct
this form so that the eightOnlyData controls only become relevant once
the user has tabbed away from the account number control (and it is 8
digits)?

-- 
-----------------------
 Alistair_Coles@hp.com
 www.hpl.hp.com
-----------------------
Received on Monday, 28 January 2002 11:22:26 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:21:50 GMT