V6 Help with Hide / Show

hangbill 05 Jan, 2019
v6
Trying to get this functionality working.
Easiest to explain with pic.

Dropdown values
=
y=Yes
n=No

The target text box, text3, is set to hide on load and to show when selecting yes under select2.
But does not show, stays hidden.

Can u see what's wrong here?
Thanks

V6 Help with Hide / Show image 1



V6 Help with Hide / Show image 2
healyhatman 05 Jan, 2019
Get rid of the X in your Load State field. CF hides fields using the hidden class, not the hidden boolean.

Either the events as you have them set should make it hidden on load, or you can add hidden to the field class under advanced.
hangbill 05 Jan, 2019
Thanks healyhatman.

Cant see how to use an event to make it hidden on load.
For the class approach I just typed hidden in the extra attributes box, no period prefix. Correct?
Kinda working. The hidden class hides the text box but the text box label still shows. And choosing yes in select2 does not show text3.
healyhatman 05 Jan, 2019
Go back to how it was then but get rid of the # in your element identifier in the dropdown event
hangbill 05 Jan, 2019
No same story. Text box is hidden but label shows and selecting yes in the txt box has no effect. Also tried "" around the Yes, and tried y because they are strings but no go.

V6 Help with Hide / Show image 3
healyhatman 05 Jan, 2019
Is Yes the VALUE or the LABEL of your selection.
hangbill 05 Jan, 2019
In V5 this is how you hide an element and its label on load (parent hidden), and how you hide show elements based on selection of another element. Dont see same functionality in V6.


V6 Help with Hide / Show image 4

V6 Help with Hide / Show image 5
healyhatman 06 Jan, 2019
Just have a look at the "Field events" demo form.
hangbill 06 Jan, 2019
Well that's odd because the functionality does not work in their demo - not on my PC anyway. Both Choose Computer OS and Choose Mobile OS are visible when I hit Preview. There must be an OnLoad function, or similar, that needs setting. I put hidden like u suggested in the Extra Attributes box under Advanced and that did not help. Why didn't they keep the conditional field functionality that worked in V5. Not everything has to be changed on an upgrade. Quite frustrating.
healyhatman 06 Jan, 2019
Well then you might want to check your javascript console for errors because the demo works perfectly for me.
healyhatman 06 Jan, 2019
Also I never suggested that you put anything in Extra Attributes.
hangbill 06 Jan, 2019
OK, will do
A few posts back you suggested a hidden field class under advanced - where / how do I do that ?
healyhatman 06 Jan, 2019
Don't worry about it, don't put hidden anywhere. If you set your field events up correctly they should be checked on load.

But if the demo form isn't working then something's wrong on your site.
hangbill 06 Jan, 2019
hmm, in Firefox console get Empty string passed to getElementById(). Tried other browsers too.
healyhatman 06 Jan, 2019
Try to reinstall CF or something, it should be working. Got any SEO / SEF plugins running? jQuery Easy or anything like that?
hangbill 06 Jan, 2019
I need to back track - time constraints.
Have a working Joomla reg form in V5, conditional fields working etc. But I understand now that I set it up incorrectly, all the additional user fields are in the Users table. So I was originally trying to correct that situation -http://www.chronoengine.com/forums/posts/t106537/custom-user-fields?keywords=custom%20user%20fields.
Then thought, well if cant get that working will try V6. Like a Bok line attack from the left, then the right, pass back, kick forward ... but the defense is solid man.
So I'm going to stay with fixing my V5 form. Thanks for trying to help, appreciate it.
This topic is locked and no more replies can be posted.