Download & Extend

Newb: Can Conditional Fields be seen by anonymous users?

Project:Conditional Fields
Version:6.x-1.1
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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

#1

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.

#2

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

#3

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

#4

Status:active» fixed

Closing old support requests...

#5

Status:fixed» closed (fixed)

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