Score:0

theme_preprocess_form_element can't remove $field_suffix

cn flag

I'm trying to remove #field_prefix by using theme_preprocess_form_element like this

function estore_preprocess_form_element(&$variables) {
  if (isset($variables['name']) && $variables['name'] == "field_dimensions[0][length]") {
    $variables['element']['#field_suffix'] = "";
  }
}

I can see in the debugger that code is working and setting the variable to empty, but once the page renders suffix is still there.

Field is question is from phyiscal field contrib module.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.