in reply to Re: HTML::FormFu element attributes
in thread HTML::FormFu element attributes

I took your advice and re-thought the way I was using CSS on my forms. I guess I needed a kick in the butt to do it right (something I know from the textbooks, but was falling short in my actual implementation).

Today I re-wrote my HTML::FormFu, and added some surrounding Blocks (tag: div) around my elements, corrected my CSS to target the selectors more precisely, and I now have the kind of form I wanted, where the long text inputs (Name and Address) are stacked vertically, and the shorter fields (City-State-Zip) are on one line (horizontally).

In every case, I have my label sitting on top, aligned to the left edge of the Input box. Neat!

Thanks again, Monks. You do a great service to the Perl community here.

Replies are listed 'Best First'.
Re^3: HTML::FormFu element attributes
by Your Mother (Archbishop) on Sep 22, 2009 at 17:30 UTC

    Nice going. :) Don't forget you can add classes to your form pieces too and that's usually all you need; i.e., another wrapper tag (Block) is usually overkill. E.g., I add a date class to my date stuff so I can attach a jQuery date/calendar selector to it-

    - type: DateTime name: publish add_attributes: class: date label: Publish Date auto_inflate: Yes

    Update: Looking at your YAML again, I think you already knew this... :)

      Yes, I did play with that. And I also discovered that you really CAN get at that enclosing Div tag (around every element). It is "container_attributes", and is used as:

      elements: - type: Text label: Client Name attributes: name: cname class: txtinput size: 55 maxlen: 80 value: %% client.name %% container_attributes: title: Name of Client class: txtContain

      This puts my own class, "txtContain", in front of the "text label" classes already inserted by FormFu.