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

RE: Hide/show select options

From: Jonathan Curtis <Jonathan.Curtis@sesame.co.uk>
Date: Mon, 6 Jun 2005 16:32:49 +0100
Message-ID: <080D146539A97F4E95B862BF4D9FBCB703B40EC4@chlexc01.sesame.com>
To: "Swithun Crowe" <swithun@swithun.servebeer.com>
Cc: <www-forms@w3.org>

Thanks Swithun. I don't really like the idea of having to force the form to rebuild though. I like things to just 'work' :)

I have come up with this solution (below), which works. I believe my original suggestion should work. Perhaps a bug with implementations? Or maybe relevant not supposed to be used in this way. I was under the impression that when a node was not relevant, it is effectively removed from the instance. This can't be happening though, else the first way would work.

If anyone had a better way, or explaination why my first idea doesn't work, I'd love to hear.


<html xmlns:xf="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events">
    <title>Test XForm</title>
      <xf:instance id="inst">
      <xf:instance id="form_data">
            <item relevant="true">
            <item relevant="true">
            <item relevant="true">
      <xf:bind id="test" nodeset="/test"/>
      <xf:bind id="select" nodeset="instance('form_data')/select/value"/>
      <xf:bind nodeset="instance('form_data')/select/item[3]/@relevant" calculate="instance('inst') = 1"/>
    <xf:input bind="test">
    <xf:select1 bind="select">
      <xf:itemset nodeset="instance('form_data')/select/item[@relevant = 'true']">
        <xf:label ref="label"/>
        <xf:value ref="value"/>

This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
Received on Monday, 6 June 2005 15:30:31 UTC

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