Hi,

Is it possible to use Conditional Fields to create a Page with a required checkbox and a some text saying "Want to see what's below?" and when the box is checked some more content is shown below?

I want this to be visible to anonymous users visiting my site, not to registered users creating content. It's to ensure that users have accepted terms and conditions before they can access a 'Buy it now' button.

Possible?

S

Comments

peterpoe’s picture

If you are inserting the HTML directly in a Page, Conditional Fields can't process it.
You can use a bit of css and javascript like this to emulate the functionality:
CSS:

#BUY-BUTTON-WRAPPER-ID {
  display: none;
}

Javascript:

$(document).ready(function() {
  $('#CHECKBOX-ID').change(function() { $('#BUY-BUTTON-WRAPPER-ID).toggle() });
});

The only drawback is that the checkbox isn't really required, so users without javascript enabled will be able to see the button anyway.

SMartin’s picture

Peter,

Thanks for that... :-)

As the site admin I'm not restricted to inserting the code straight in to the Page... (?)

Is there a way to do it through the usual methods/fields etc?

S

peterpoe’s picture

You could try the modules Panels + Editablefields, but I don't know if they work with Conditional Fields...

peterpoe’s picture

Status: Active » Fixed

Closing old support requests...

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.