Building Xforms where select options depends on the value of the previous question!

Hi All,

I've just read the basics on "how to buid XForms":
http://code.javarosa.org/wiki/buildxforms

But I still have a doubt and I hope you can help me.

I need to build a couple of fields which are related/Dependant/nested/
parent-child (whatever you want to call it).

A simple example:

MAKE? (select1)
Make A
Make B
Make C
...

if Make A is selected, then the next question will be:

MODEL? (select1)
Model A.1
Model A.2
Model A.3
...

if Make B is selected, then the next question will be:

MODEL? (select1)
Model B.1
Model B.2
Model B.3
...

So the option of MODEL varies depending on the answer of the 1st
question (MAKE)

What I'd like to have at the end (after form is filled in) is
something of this kind:

FORD MUSTANG

Is it possible to achieve this using XFORMS?
can you please help me?

thanks a lot!!

Dídac

hi dídac,

you can do something like http://dpaste.com/191186/ where you have a
make question and a model_make question. your answer to make, then
makes the model_make question relevant. we are adding itemsets to
javarosa and odk and that will make this kind of question easy to
design...

yaw

··· On Wed, May 5, 2010 at 03:04, Dídac wrote: > Hi All, > > I've just read the basics on "how to buid XForms": > http://code.javarosa.org/wiki/buildxforms > > But I still have a doubt and I hope you can help me. > > I need to build a couple of fields which are related/Dependant/nested/ > parent-child (whatever you want to call it). > > A simple example: > > > MAKE? (select1) > Make A > Make B > Make C > ... > > if Make A is selected, then the next question will be: > > MODEL? (select1) > Model A.1 > Model A.2 > Model A.3 > ... > > > if Make B is selected, then the next question will be: > > MODEL? (select1) > Model B.1 > Model B.2 > Model B.3 > ... > > > So the option of MODEL varies depending on the answer of the 1st > question (MAKE) > > > What I'd like to have at the end (after form is filled in) is > something of this kind: > > > FORD > MUSTANG > > > > Is it possible to achieve this using XFORMS? > can you please help me? > > thanks a lot!! > > Dídac >

Thanks a lot for your detailed explanation!

Dídac

··· On 5 May 2010 16:03, Yaw Anokwa wrote:

hi dídac,

you can do something like http://dpaste.com/191186/ where you have a
make question and a model_make question. your answer to make, then
makes the model_make question relevant. we are adding itemsets to
javarosa and odk and that will make this kind of question easy to
design...

yaw

On Wed, May 5, 2010 at 03:04, Dídac gdidac@gmail.com wrote:

Hi All,

I've just read the basics on "how to buid XForms":
http://code.javarosa.org/wiki/buildxforms

But I still have a doubt and I hope you can help me.

I need to build a couple of fields which are related/Dependant/nested/
parent-child (whatever you want to call it).

A simple example:

MAKE? (select1)
Make A
Make B
Make C
...

if Make A is selected, then the next question will be:

MODEL? (select1)
Model A.1
Model A.2
Model A.3
...

if Make B is selected, then the next question will be:

MODEL? (select1)
Model B.1
Model B.2
Model B.3
...

So the option of MODEL varies depending on the answer of the 1st
question (MAKE)

What I'd like to have at the end (after form is filled in) is
something of this kind:

FORD MUSTANG

Is it possible to achieve this using XFORMS?
can you please help me?

thanks a lot!!

Dídac