Hi all,

I fear this might not be my first post to the group in the next day or to in relation to Zend_Form, I just don't seem to be getting a complete grasp of it yet.

My first problem. I am trying to implement mark-up for an element like this:

<div class="input_password">
        <label for="">Password:</label>
        <input id="" name="" type="password" size="20" />
        <p><a href="#">Forgotten Password</a></p>
</div>

I configure my form using an XML config. I can get the form element wrapped in the div without any problems using the following config snippet (which is the element configuration for this element):

<password>
        <type>password</type>
        <options>
                <label>Password:</label>
                <validators>
                        <alnum>
                                <validator>alnum</validator>
                                <breakChainOnFailure>true</breakChainOnFailure>
                        </alnum>
                        <stringlength>
                                <validator>StringLength</validator>
                                <options>
                                        <min>5</min>
                                        <max>20</max>
                                </options>
                        </stringlength>
                </validators>
                <decorators>
                        <viewhelper>
                                <type>ViewHelper</type>
                        </viewhelper>
                        <label>
                                <type>label</type>
                        </label>
                        <divWrap>
                                <type>HtmlTag</type>
                                <options>
                                        <tag>div</tag>
                                        <class>input_password</class>
                                </options>
                        </divWrap>
                </decorators>
        </options>
</password>

Now I understand that I cannot add a second HtmlTag decorator, but can anyone suggest any other way of achieving my element layout (adding the additional '<p><a href="#">Forgotten Password</a></p>' after the input element) without using a customer decorator class?

The more observant amongst the group might notice I posted a different Zend_Form question a week or so ago... Don't worry... I'm not that slow, I've only just got back to my forms today!!

:wq
Greg.


Reply via email to