Skip Navigation

[Resolved] Conditional Display depending on Checkbox

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to use conditional HTML that displays depending on a checkbox.

Solution: Use the following conditional syntax.


 

This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 12 replies, has 3 voices.

Last updated by michaelA-13 6 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#631815
Screen Shot 2018-04-05 at 10.41.59.png

I am trying to:

Show Text depending on checkbox value

With the first two line I receive 1 as a result which is expected since the box is checked.

But the latter two return nothing.

{!{types field='mitglied-vinothek'}!}{!{/types}!}

{!{types field='mitglied-vinothek' output='raw'}!}{!{/types}!}

{!{wpv-conditional if='( $(wpcf-mitglied-vinothek) eq '1' )' debug='true'}!} Box is checked! {!{/wpv-conditional}!}

{!{wpv-conditional if='( $(wpcf-mitglied-vinothek) ne '' )'}!}  Box is checked! {!{/wpv-conditional}!}

hidden link

#631882

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The access detail you shared with us is not working. and showing error: ERR_TOO_MANY_REDIRECTS

Could you please send me working wp-admin access details.

I have set the next reply to private which means only you and I have access to it.

#631913
#631916

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

When trying the URL: hidden link

It's just keep loading and loading and at last I see this error on browser page: ERR_TOO_MANY_REDIRECTS

#631922

Hi Minesh, I deactivated Password Protection. Could you check if it works for you now?

Michael

#631927

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

No luck - not working yet.

#631931

Hi Minesh,

this is odd since I already got repeated help from here on that site.

This also returns a result.

hidden link

However could you try: hidden link

Michael

#631935

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Sorry - no luck still. If you want I can assign this ticket to supporter of your choice. Christian Cox is available now. You want me to pass this ticket to him?

#631937

Yes please do so. Maybe he has more luck 🙂

#631949
Screen Shot 2018-04-05 at 9.53.19 AM.png

I'm also having trouble. This URL leads to a login page with no CSS applied:
hidden link
See the attached screenshot.

This URL never loads and I get a "too many redirects" error:
hidden link

However, this URL loads as expected:
hidden link

So I'm not really sure what's going on here. Do you have any other advice that would help us log in?

#631956

Hi Christian,

I can only figure that there is a www redirect issue. I removed the www. from wordpress.

Could you try again:

hidden link

hidden link

hidden link

Michael

#632037

Sorry, I'm still not able to log in.

hidden link - This works as expected and I see the homepage

hidden link - This never loads, too many redirects

hidden link - This loads without CSS like before. I submitted login credentials anyway, but then I cannot see the wp-admin dashboard. I am redirected to this URL: hidden link It never loads, too many redirects. I tested in different browsers, but I'm not able to access wp-admin.

At this point, it's probably best if you provide a clone of your website so I can install it locally and run some additional tests without this redirect issue causing problems. I usually recommend the Duplicator plugin. You can install it and create a clone of your site, then post the backup to Dropbox or Drive and provide a link here for me to download. Or, you can provide a link to download a SQL dump from your site's database.

#632042
#632103

Got it, thanks. I'm not sure what's going on with your server but the database dump works fine for me. I'm able to see the problem. The last two lines seem to have a bad combination of quotation marks, so not even the debug information was appearing. Try single quotes nested in double quotes, like this:

{!{wpv-conditional if="( $(wpcf-mitglied-vinothek) eq '1' )" debug="true"}!} Box is checked! {!{/wpv-conditional}!}

{!{wpv-conditional if="( $(wpcf-mitglied-vinothek) ne '' )"}!}  Box is checked! {!{/wpv-conditional}!}
#632221

Hi Christian,

thank you 🙂

Is this a problem on my side? I used the GUI to set up the conditional statement and that gave me the combination of quotes.

Michael