W3C home > Mailing lists > Public > www-forms@w3.org > November 2006

Re: Repeat and Submission

From: Swithun Crowe <swithun@swithun.servebeer.com>
Date: Wed, 8 Nov 2006 16:23:41 +0000 (GMT)
To: Christian Lebe <christianlebe@gmail.com>
cc: www-forms@w3.org
Message-ID: <Pine.LNX.4.64.0611081613540.4422@shadrach.swithun.servebeer.com>


CL I'm a noob at xforms so any help on this will be very much appreciated.
CL Basically, I have two dropdown list that are dependants to the option
CL selected on the first one.

You could make a few changes, which might make your form work.

CL <xf:instance id="values" src="admin.cgi?action=getPermissionAccess"/>

This could be something like:

<xf:instance id="values"><root xmlns=""/></xf:instance>

to start with. It only needs to be populated once an item from the first 
list is selected.

CL        <xf:submission id="getValue" instance="values"
CL ref="instance('form')/access[index('accessRepeat')]"
CL action="admin.cgi?action=getPermissionAccess"
CL method="post" replace="instance" />

You want to @ref instance('form')/access/type here - this is what holds 
the selected value in the first list, so is presumably what you want to 
send back and use to populate the second list.

CL             <xf:send ev:event="xforms-value-changed" submission="getValue"
CL at="index('accessRepeat')">

You don't need at @at attribute for xf:send.

A while ago Mark Birbeck posted a link to his blog showing how to emulate 
Google Suggest with 5 lines of XForms, rather than 100 lines of 
JavaScript. It is pretty much what you want to do (swapping xf:input for 
xf:select1). That page will explain everything.

Received on Wednesday, 8 November 2006 16:27:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:37:54 UTC