killedfriendz Posted March 4, 2021 Share Posted March 4, 2021 I am very sorry for asking this but i totally do not understand how to set values of checbox using API. I have checbox field on my page with name "order_status". So i've tried few ways to make it checked but it still doesn't work: $userPage->order_status->value = 1; $userPage->order_status->add(1); $userPage->order_status->add(true); Could you please tell me how to do it? Link to comment Share on other sites More sharing options...
3fingers Posted March 4, 2021 Share Posted March 4, 2021 $userPage->order_status = 1; // simple as that 1 Link to comment Share on other sites More sharing options...
zoeck Posted March 5, 2021 Share Posted March 5, 2021 and don't forget to save the value/page! 😉 $userPage->save(); https://processwire.com/api/ref/page/save/ Link to comment Share on other sites More sharing options...
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