I would like to set a form item visible depending on something like this $a>4.
Is this possible using states in form api?
An Excerpt from one of my modules.
The first assignment to the $form array picks up as it's value an ordinary PHP variable. If you replaced the line
#value => $user_has_administer_users_rights
#value => $a>4 ? 'yes' : 'no',
it should work for you.
I'll leave to to contextualise the rest of the code :)
Hope this helps.
Add to new playlist:
Add to cart:
Below are the supported keyboard shortcuts for our video player.
Share a link, or share with Facebook and Twitter:(you'll be able to edit the text before you post it)
It looks like there might be an issue playing videos in this browser. We're working on better cross-brower experience, but in the meantime please try the latest Chrome or Firefox browsers. Or, you may be able to watch the video directly without progress tracking or transcript:
Answer a few quick questions and we'll help you figure out what to watch first.
See a full list of all 2000+ videos on BuildAModule (great for quick browser searching).
Learn more about the different video collections.