pjf5066 Posted October 9, 2014 Posted October 9, 2014 Hi all fairly new to php and processwire and am having trouble setting a value of one of my fields. Quick background - I have active projects, pending projects, and completed projects in my system. If the job is active, then I need to set the field 'is_active' to checked (or I can have a selection and set the selection to Active). Either way I have an if statement determining if the project is active. Once I determine it is active, how do I set a checkbox to checked and store in on the databse from the php side?
LostKobrakai Posted October 9, 2014 Posted October 9, 2014 ProcessWire handles checkboxes internaly with 0 and 1 integers. So you need to do this, to enable the checkbox field and save it. $page->of(false); // disable output formatting $page->checkbox = 1; $page->save(); 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now