Categories > TinyButStrong general >

Display inputs and labels.

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Dima
Date: 2011-07-01
Time: 21:39

Display inputs and labels.

Hi,

I'd like to know how to display inputs and the corresponding labels behind/underneath/after each other.

This is my template source:

<div>
   
    <input id="input_[blk.id;block=input]" type="checkbox" name="input_[blk.id]" value="[blk.id]" />
    <label for="input_[blk.id]">[blk.name;block=label]</label>
   
</div>

And this is the corrsponding array:

$blk = array();
$blk[] = array('name' => 'ABS', 'id' => 1);
$blk[] = array('name' => 'ESP', 'id' => 2);
$blk[] = array('name' => 'DSC', 'id' => 3);
$blk[] = array('name' => 'All-Wheel-Drive', 'id' => 4);
$blk[] = array('name' => 'Airbags', 'id' => 5);

I'd like to have each label tag following an input tag. Can someone advise?
By: Skrol29
Date: 2011-07-03
Time: 00:02

Re: Display inputs and labels.

Hi,

> I'd like to know how to display inputs and the corresponding labels behind/underneath/after each other.

Can you more precise ?

Is this what you need ?

<div>

<input id="input_[blk.id;block=div]" type="checkbox" name="input_[blk.id]" value="[blk.id]" />
<label for="input_[blk.id]">[blk.name]</label>

</div>