[html-formfu] Issue with a text label

Kamen Naydenov pau4o at kamennn.eu
Thu Jun 2 09:15:32 GMT 2011


On Thu, Jun 2, 2011 at 11:27, George Hrysanthopoulos <xaos at darksmile.net> wrote:
> Ok, this should be simple but I am drawing a blank.
>
> How do I create a text field (or a password field),
> in YML, and have the label start on a new line (not the same line
> as the text field.
>
> Normally (in a form) I just do:
>
> Userid:<br /> <input type="text" size="30" /><br />
>
> And it works.
>
> Thank you in advance.
>
> -George

Visual appearing of form elements is controlled via CSS styles (avoid
using <br />)
Here is example of YML for login form:
<yml>
---
auto_id: '%n'
auto_constraint_class: '%t'
# indicator is the field that is used to test for form submission
indicator: submit
auto_fieldset:
  legend: Login form
# Start listing the form elements
elements:
  - type: Text
    name: username
    label: Userid
  - type: Password
    name: password
    label: Pass
  - type: Submit
    name: submit
</yml>

Than you need something like following CSS snippet:
<css>
label { display: block; }
</css>

And this will put labels on new line.

best regards
Kamen



More information about the HTML-FormFu mailing list