State of form element based on global config I have a form_alter that adds some settings on a content type. How can I make one of these elements hidden (and cleared?) based on the value of a global config (set with variable_get)? I found the states api, but that only manipulates elements based on the values of other elements on the same form. Is there a best practice for what I am trying to do?
You can unset a form element using this code :

var x = variable_get("VariableName");
if(x confirmed some condition)
{
  unset($form[$ELEMENT_YOU_DESIRE_TO_HIDE]);
}