$this->label = new html_label();
$this->label->for = $for;
if (empty($for)) {
- $this->generate_id();
+ if (empty($this->id)) {
+ $this->generate_id();
+ }
$this->label->for = $this->id;
}
$this->label->text = $text;
$field->prepare();
$this->prepare_event_handlers($field);
$output = $this->output_start_tag('span', array('class' => "textfield $field->name"));
+ if (!empty($field->label)) {
+ $output .= $this->label($field->label);
+ }
$output .= $this->output_empty_tag('input', array(
'type' => 'text',
'name' => $field->name,