Skip to main content
deleted 2 characters in body
Source Link
Citricguy
  • 7.9k
  • 10
  • 58
  • 104

I got the following issue. A clients wants that the text after checkboxes are links to other pages and thus between ...

I have the following code:

$form['boxes_brands'] = array(
      '#type' => '#type'=>'checkboxes''checkboxes',
      '#title' => '#title'=>'<div'<div id="title-container">Merken</div>',
      '#options' => '#options'=>$brandArr$brandArr,
      '#default_value' => '#default_value'=>$_SESSION['filter_brands_cat']$_SESSION['filter_brands_cat'],           
    );

=> $brandArr$brandArr is an array of brands.

I looked in the Form ApiAPI of Drupal but I did not find an option to do this. I could alter the values in $brandArr$brandArr but of course that changes the value of the value attribuutattribute of the input object too.

Using the prefix and suffix options won't do itwork either because I don't want the checkboxes in the tags too.

Is there a clean way to do this?

Thanks!

I got the following issue. A clients wants that the text after checkboxes are links to other pages and thus between ...

I have the following code:

$form['boxes_brands'] = array(
        '#type'=>'checkboxes',
        '#title'=>'<div id="title-container">Merken</div>',
        '#options'=>$brandArr,
        '#default_value'=>$_SESSION['filter_brands_cat'],           
    );

=> $brandArr is an array of brands.

I looked in the Form Api of Drupal but I did not find an option to do this. I could alter the values in $brandArr but of course that changes the value of the value attribuut of the input object too.

Using the prefix and suffix options won't do it either because I don't want the checkboxes in the tags too.

Is there a clean way to do this?

Thanks!

I got the following issue. A clients wants that the text after checkboxes are links to other pages and thus between ...

I have the following code:

$form['boxes_brands'] = array(
    '#type' => 'checkboxes',
    '#title' => '<div id="title-container">Merken</div>',
    '#options' => $brandArr,
    '#default_value' => $_SESSION['filter_brands_cat'],
);

$brandArr is an array of brands.

I looked in the Form API of Drupal but I did not find an option to do this. I could alter the values in $brandArr but of course that changes the value of the value attribute of the input object too.

Using the prefix and suffix options won't work either because I don't want the checkboxes in the tags too.

Is there a clean way to do this?

Source Link

Altering the text after a checkbox using the Drupal Form Api

I got the following issue. A clients wants that the text after checkboxes are links to other pages and thus between ...

I have the following code:

$form['boxes_brands'] = array(
        '#type'=>'checkboxes',
        '#title'=>'<div id="title-container">Merken</div>',
        '#options'=>$brandArr,
        '#default_value'=>$_SESSION['filter_brands_cat'],           
    );

=> $brandArr is an array of brands.

I looked in the Form Api of Drupal but I did not find an option to do this. I could alter the values in $brandArr but of course that changes the value of the value attribuut of the input object too.

Using the prefix and suffix options won't do it either because I don't want the checkboxes in the tags too.

Is there a clean way to do this?

Thanks!