Forums

Show/hide textarea based on other field value

SPABO 16 Apr, 2017
Hi Max.

I followed the rules as in the demo form (Show/hide fields based on other fields values), but to my opinion it does not work with a textarea

Case:
I created a dropdown ( No vs Yes)
If "No"is selected the area must be hidden
If "yes" is selected, the area must be shown

FYI : I do it with a checkboxesgroup, it works fine

My question, does it work on your side, using the same rules?

Rgds
Kees
Max_admin 16 Apr, 2017
Hi Kees,

What do you have the "Events" section of the dropdown ?

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
SPABO 16 Apr, 2017
Hi Max
Leave for waht it is, it's not workable to get a simply form in V6
I'm now getting errors
I deleted teh table, and wanted to create a new table, but this systems does not allow to create a table with a specific name
SPABO 16 Apr, 2017
Getting it working again..

Now back to the issue, pls find some pictures
SPABO 16 Apr, 2017
Additionally
Working fine when using Radios Group and/or Checkboxes Group

Does not work (al least not here) with
Textfield and/or Textarea
Max_admin 17 Apr, 2017
Hi Kees,

You should only have 2 events, one when "selecting" "y" to "show" the textarea, and another when "selecting" "n" to "hide" the textarea, but right now you have conflicting events, the 1st and the 4th for example.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
SPABO 17 Apr, 2017
Hi Max,
Sorry, but this does not solve this.
I would be very pleased if yoy could show screendumps so I can check what I did wrong.

Look forward to see your solution

Best regards

Kees
GreyHead 17 Apr, 2017
Hi Kees,

I got this to work. Note that the Element identifier is .field #textarea2 - that is a CSS selector for the parent div of the textarea so that the whole element is hidden.

Bob
[attachment=270_20170417092936_2017-04-17-11-27-27-png.png][/attachment]
SPABO 17 Apr, 2017
Hi Bob
This does not work as wel, even when I put .fieldl#textarea31 (is the new area nbr)
Rgds
Kees
Max_admin 17 Apr, 2017
Hi Kees,

Bug found, there is a problem when the target element is a "textarea".

I think Bob's code should work but you need to have a space here: .fieldl#textarea31 >
.field #textarea31


Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
SPABO 17 Apr, 2017
Hi Max,

Took a couple of hours, but's that's the trick. How could I know???

Maybe foor the future, just to make it work on "taxtarea31" only.

Best regards
Kees

(more questions to come I'm afraid 🙄 )
Max_admin 17 Apr, 2017
Hi Kees,

Yes, it should work with textarea31 only but since there is a bug, it didn't, for now you can use the code you have.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
SPABO 20 Apr, 2017
Answer
1 Likes
Hi Max,
It works now correctly on the textfield/textarea!
Rgds
Kees
FransO 30 Apr, 2017
Hi Max,

I tried the same with radio buttons as the controlling element, but that did not work. Also when the target is a multi field area instead of a single field it does not work, neither with a dropdown nor with a checkboxes group as the controlling element.

Regards,
Frans
Max_admin 01 May, 2017
Hi Frans,

What is the "Element identifier" ? if the target element does not have a "name" then you should use this:

#element_id

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
FransO 01 May, 2017
Hi Max,

Thanks, that worked and solved both problems. I feel kind of stupid for not knowing this simple solution. Should I have read this anywhere in the documentation or FAQ's?

Regards,
Frans
Max_admin 01 May, 2017
Hi Frans,

No problems, unfortunately there are not any docs or FAQs for v6 yet, but I'm trying to solve this!

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.