Forums

Conditional fields + required

Mushr00m 28 Jan, 2011
Hi all !

I need to create some conditional fields in a form. For a simple example :

What is your job ?
- A
- B
- C
- other


If the person check "other" must appear a input field that is Required. You understand that if the personn check "A" for example it will be a trouble because the new input field still required even if is not shown. For the conditional enable/disable field, I found my answer (I think) on the forum (http://www.chronoengine.com/forums/index.php?option=com_chronoforums&cont=posts&f=5&t=13829&hilit=conditional&start=30).

But I don't know how to do for the required or not field ? I read something about the livevalidation but seems to complicated for a so little thing. I read an other thing about changing the class on the fly, is it possible ? and how ?

Thank you all !
GreyHead 30 Jan, 2011
Hi Mushr00m,

Changing the class won't work with the ChronoForms LiveValidations as the validations are attached to the inputs when the page loads and changing the class after that doesn't change the validation.

This is a tricky problem and I'm not sure that there is a good solution; there are several threads about it though and you may find a better answer if you search.

Bob
Mushr00m 09 Feb, 2011
Thank you for your answer. I didn't found a good solution for the moment so if you have an idea 😀

TO show what I need, I saw it on the Breezing Form demo site here (using the turn on button add an input) :
http://crosstec.de/turn-fields-onoff.html

Thanks for all your work.
GreyHead 09 Feb, 2011
Hi Mushr00m,

The demo on the Breezing forms site is very easy to do - explained here a few times. The problem with ChronoForms is that LiveValidation doesn't work well with this approach. Or at least no-one has yet explained how to get it to work.

I have got two levels of hidden and validated inputs working in ChronoForms using the Quiksmode Usable Forms and Validation code. I'll try to write that up into a usable document.

Bob
mkusens 04 Apr, 2013
I am looking to do the same thing. I have a form where the clients wants a radio button selected by the user. If the user selects option a, I have to display a formatted text field in the form. If the user selects option b, I need to show some text box fields that are required. If option a is selected, I need it to bypass the required fields. How do I do this?
This topic is locked and no more replies can be posted.