Forums

Multiple dropdowns

StefanJ 27 Nov, 2011
Hello,

I want to create a form which has linked dropdowns.
For example:
I have one dropdown (Cars) with the options: Audi, BMW, Volkswagen and no car.

After that, I want a dropdown with options depending of the chosen option in the first dropdown.
For example: for Audi: A4, A5, A6, for BMW: 320, 330, 520, 530 and volkswagen: Golf, Passat, Variant.

After that, I want to send the form and get a message:

When a car is chosen: Yes you have a car
When no car is chosen: No you haven't a car.

Is that possible with chronoforms?

gr.

Stefan
GreyHead 28 Nov, 2011
Hi Stefan,

There's an article here on double drop-downs in CFv3 that you may be able to adapt (there may be a coding problem with this and CFv4).

There's also a tutorial that you can but here on double-drop-downs with Ajax if you need to do a database query to get the info for the second drop-down.

Bob
StefanJ 29 Nov, 2011
Thnx Bob!
I choosed the second option with Ajax and it works like a charm!

How can I get both dropdowns required?
In the first dropdown I added "class="cf_inputbox validate-selection" and it works fine.
But the second dropdown uses Ajax and I don't know how to make it required.

gr

Stefan
GreyHead 29 Nov, 2011
Hi Stefan,

This is ChronoForms v3 you are using??

Hmmm . . . I never discovered how to add a validation after the form has been loaded :-(

The best that I can suggest is that you add a JavaScript snippet and use the Ajax call to set it up. It only needs a few lines of code.

Bob
This topic is locked and no more replies can be posted.