Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By pedrojpzzz on
Hi,
I have a piece of code that creates a select type control this way:
$selectEntitie = "<label for='selectEntitie'>";
$selectEntitie .= " ".t('Entities').":"." ";
$selectEntitie .= "<select id='FK_entities' name='FK_entities' onChange='document.getElementById(\"idRefreshGlpiPermissions\").click();'>";
$selectEntitie .= "<option value='null' >--".t('Select an entity')."--</option>";
if ( isset($estructura['entities']) && count($estructura['entities']) ){
foreach ($estructura['entities'] as $indice => $valor){
$selectEntitie .= "<option value='".$indice."'>".$valor."</option>";
}
}
$selectEntitie .= "</select></label>";
Then, this text is added to the form array as prefix section of a markup type element.
Is there any way to get the selected value of the control in the $form_state['values'] var?