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

RE: Multiple select menu with default values

From: Robert Bull <rob.bull@blackdog.co.uk>
Date: Thu, 14 Oct 2004 09:11:03 +0100
To: "Evan Lenz" <evan@evanlenz.net>, <www-forms@w3.org>
Message-ID: <HGEBLDGAEJLFJAEBFHFAAECPCFAA.rob.bull@blackdog.co.uk>


Try binding the xForms:Select to a single node, then give the single node in
the initial instance a space separated list of your default values, you
should achieve this.


        <xforms:select ref="//root/list_res" >
           <xforms:itemset model="test" nodeset="//root/set/node">
              <xforms:label ref="@val1"/>
              <xforms:value ref="@val2"/>

then in the instance:

			<node val1="apples" val2="a">
			<node val1="bannanas" val2="b">
			<node val1="pears" val2="p">
		<list_res>a p</list_res>

your select should be rendered with the apples bannanas and pears as the
list items, with apples and pears initially selected. Cnange the selectio to
bannanas and the submitted xml will contain

Note the restriction that the value cannot contain spaces.

Hope this helps.



*  This e-mail is for the intended recipient only, *
*  its contents and the content of any attachments *
*  is copyright material belonging to HoT Training *
*  and Consultancy Ltd, and all information herein *
*  should be treated as Company Confidential       *

-----Original Message-----
From: www-forms-request@w3.org [mailto:www-forms-request@w3.org]On
Behalf Of Evan Lenz
Sent: 13 October 2004 23:41
To: www-forms@w3.org
Subject: Multiple select menu with default values

Is there an XForms equivalent to the HTML below that would submit the same
GET request as an HTML browser would (with separate name/value pairs as in

<select name="f" multiple>
  <option value="opt1" selected>Option 1</option>
  <option value="opt2">Option 2</option>
  <option value="opt3" selected>Option 3</option>
  <option value="opt4">Option 4</option>

I might not be looking in the right places, but so far it doesn't look like
this is possible. (I see how <itemset> could be used to bind to multiple <f>
elements, but I don't see how to specify default values in that case.) If
someone could prove me wrong, that would be nice.

Received on Thursday, 14 October 2004 08:11:36 UTC

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