0

I have 2 fields in a content type.

field_link and field_hoster

if in the hoster field youtube is selected the markup should embed the linked video.

can you guys give me a example of what i have to write in the markup field?

1
  • #markup is used to set HTML that will be output on the form in drupal
    – rfegade
    Commented Sep 23, 2015 at 10:51

1 Answer 1

1

use hook_form_alter()

$form['field_name'] = array(
  '#type' => 'markup',
  '#markup' => $form['field_name'][#value]
);

or you can use prefix or suffix

$form['field_name']['#prefix'] = '<div class="field-name"><label>'.$form['field_name']['#value'] .'</label>';

Not the answer you're looking for? Browse other questions tagged or ask your own question.