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

Testing for listItem

From: Frederik Elwert <felwert@uni-bremen.de>
Date: Thu, 18 Oct 2007 15:49:29 +0200
To: www-forms@w3.org
Message-Id: <1192715369.6254.19.camel@FredDesk>

Hello!

I just was wondering how I can test for a specific listItem in a
variable of type xforms:listItems.

I have a select that offers several options:
        
        <select ref="flavors" appearance="full">
           <label>Flavors:</label>
           <item>
              <label>Vanilla</label><value>v</value>
           </item>
           <item>
              <label>Strawberry</label><value>s</value>
           </item>
           <item>
              <label>Chocolate</label><value>c</value>
           </item>
        </select>

Now I have another item that should test if "Chocolate" was chosen, e.g.
in a "relevant" property. How can I achieve this?

Using XPath functions as "contains()" seems a bit strange, since I could
have values like "a" and "ab", so
        contains(flavors, 'a')
would match "a" as well as "ab".

Is there a proper way? I can't use structured markup and itemset, since
I need HTML forms compatibility.

Thanks,
Frederik
Received on Thursday, 18 October 2007 13:49:38 GMT

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