Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmit button falling out of fieldset when using displayGroup in Zend Framework 1.10.8
    primarykey
    data
    text
    <p>I have tried all the combinations I can think off but this form:</p> <pre><code>class Form_Login Extends Zend_Form{ public function init(){ $this-&gt;setMethod('post'); $email = new Zend_Form_Element_Text('email'); $emailValidator = new Zend_Validate_EmailAddress(); $emailValidator-&gt;setMessage('Please use a valid email address'); $email-&gt;addValidator($emailValidator) -&gt;setRequired(TRUE) -&gt;setLabel("Email Address") -&gt;setAttrib('size', '35'); $password = new Zend_Form_Element_Password('password'); $password-&gt;setLabel('Password') -&gt;setAttrib('size', '35') -&gt;setRequired(true); $submit = new Zend_Form_Element_Submit('login'); $submit-&gt;setLabel('Login'); $this-&gt;addElements(array( $email, $password ) ); $this-&gt;addDisplayGroup(array( 'email', 'password' ),'loginGroup',array('legend' =&gt; 'Login')); $loginGroup = $this-&gt;getDisplayGroup('loginGroup'); $this-&gt;setElementDecorators(array( 'ViewHelper', array('Label', array('separator' =&gt; '', 'requiredPrefix' =&gt; '* ')), array('Errors'), array('HtmlTag', array('tag' =&gt; 'p', 'class' =&gt; 'form-element')), )); $loginGroup-&gt;setDecorators( array( 'FormElements', array('HtmlTag',array('tag'=&gt;'div','openOnly'=&gt;true)), 'Fieldset' ) ); $this-&gt;addElements(array($submit)); //buttons do not need labels $submit-&gt;setDecorators(array( array('ViewHelper'), array('HtmlTag', array('tag' =&gt; 'p', 'class' =&gt; 'submit-button')) )); } } </code></pre> <p>Displays fine in google chrome like the image below:</p> <pre><code>&lt;fieldset id="fieldset-loginGroup"&gt;&lt;legend&gt;Login&lt;/legend&gt; &lt;div&gt; &lt;p class="form-element"&gt;&lt;label for="email" class="required"&gt;* Email Address&lt;/label&gt; &lt;input type="text" name="email" id="email" value="" size="35"&gt;&lt;/p&gt; &lt;p class="form-element"&gt;&lt;label for="password" class="required"&gt;* Password&lt;/label&gt; &lt;input type="password" name="password" id="password" value="" size="35"&gt;&lt;/p&gt; &lt;p class="submit-button"&gt; &lt;input type="submit" name="login" id="login" value="Login"&gt;&lt;/p&gt;&lt;/div&gt; &lt;/fieldset&gt; </code></pre> <p>And in firefox it falls out of the fieldset tags so it looks like this:</p> <pre><code>&lt;dl class="zend_form"&gt; &lt;fieldset id="fieldset-loginGroup"&gt;&lt;legend&gt;Login&lt;/legend&gt; &lt;div&gt; &lt;p class="form-element"&gt;&lt;label for="email" class="required"&gt;* Email Address&lt;/label&gt; &lt;input name="email" id="email" value="" size="35" type="text"&gt;&lt;/p&gt; &lt;p class="form-element"&gt;&lt;label for="password" class="required"&gt;* Password&lt;/label&gt; &lt;input name="password" id="password" value="" size="35" type="password"&gt;&lt;/p&gt;&lt;/div&gt; &lt;/fieldset&gt; &lt;p class="submit-button"&gt; &lt;input name="login" id="login" value="Login" type="submit"&gt;&lt;/p&gt;&lt;/dl&gt; </code></pre> <p>I know the browser should not make much of a difference as the tags are generated server-side. I cannot however get the submit button to fall within the field set in firefox. I have not tried any other browser besides these two so I am not sure how it would look on them. Any help...?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload