Forums

How can I show/hide a textarea when a checkbox is clicked?

Uphill 16 May, 2013
I read the FAQ about hiding a textarea when I checkbox is not clicked.

But I can't get it to work. The textarea stays visible and it doesn't matter if the checkbox is checked or not. And I have no idea what I'm doing wrong.

So far I did these steps in preview: (i'm using the advanced wizard)
1. Create a checkbox element with name and field id checkbox
2. Create a textarea with name and field id textarea
3. Create a submit button

At events I did 2 steps:
1. Create a load js and put the code there from the FAQ
2. Create the show html

After saving I still have the textarea visible. So what am I doing wrong?
GreyHead 16 May, 2013
Hi Uphill,

Please post a link to the form so I can take a quick look.

Bob
Uphill 16 May, 2013
I get it to work somehow.
Don't know what I did. I was already trying for 3 hours and suddenly it worked.

So now I went a step further because I wanted multiple checkboxes and textarea's

That worked as well.

But now the last step is to have one checkbox which unlocks multiple textfields.
I tried to put the fields in a container and let the checkbox refered to the container name but I probably did something wrong because it didn't work.
Any idea how to get it worked?
GreyHead 10 Jul, 2013
Hi rosaria,

In the FAQ the checkboxes have different ids - yours all have the same id.

Bob
rosaria 16 Jul, 2013
Hello GreyHead, I do the same type of form I associate more checkboxes to more textarea:

example:
checkboxe_1: textarea1, textarea2, textarea3

checkboxe_2: textarea4, textarea5, textarea6

GreyHead 22 Jul, 2013
Hi Rosaria,

I'm sorry but I don't understand your post :-(

Bob
GreyHead 22 Sep, 2013
Hi jcmafra,

It looks good from here - checked in Chrome & FF.

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