Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8974397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:40:14+00:00 2026-06-15T18:40:14+00:00

I´m developing an application using Zend Framework 2 and I use FormRow helper to

  • 0

I´m developing an application using Zend Framework 2 and I use FormRow helper to render a label, the input and errors (if present) in a Form.

//within the view
echo $this->formRow($form->get('Name'));

When a user submits the form without filling the required input text field FormRow render´s it with the following error message:

<label>
    <span>Name: </span>
    <input class="input-error" type="text" value="" placeholder="Insert Name Here" name="Name">
</label>
<ul>
    <li>Value is required and can't be empty</li>
</ul>

How can I set a class for the li tag to style it afterwards?

I know that I can echo the formElementErrors with the desired class attribute via..

<?php echo $this->formElementErrors($form->get("Name"), array('class' => "valuerequired", 'message' => "errortestmessage")); ?>

..but FormRow will still render the error message without the class.

Just for reference I´m setting the entity this way:

public function getInputFilter()
    {
        if (!$this->inputFilter) {
            $inputFilter = new InputFilter();

            $factory = new InputFactory();

            $inputFilter->add($factory->createInput(array(
                'name'     => 'Name',
                'required' => true,
                'filters'  => array(
                    array('name' => 'StripTags'),
                    array('name' => 'StringTrim'),
                ),
                'validators' => array(
                    array(
                        'name'      => 'StringLength',
                        'options' => array(
                            'encoding' => 'UTF-8',
                            'min'      => 1,
                            'max'      => 100,
                        ),
                    ),
                ),
           )));

            $this->inputFilter = $inputFilter;
        }
        return $this->inputFilter;
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:40:15+00:00Added an answer on June 15, 2026 at 6:40 pm

    Ok, the solution to my own problem was right in front of me, instead of using:

    //within the view
    echo $this->formRow($form->get('Name'));
    

    I called each element of the form individually:

        //within the view
        echo $this->formLabel($form->get('Name'));
        echo $this->formInput($form->get('Name'));
        echo $this->formElementErrors($form->get("Name"), array('class' => "some_class", 'message' => "errormessage")); 
    

    Don´t know if it´s the most efficient way of doing it, plz drop a line if you think otherwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been developing a PHP application using the Zend framework for awhile on a
I am developing a web application using zend framework. For select statements I have
I´m developing an application using Zend Framework 2 and I´m using two select multiple
I am developing an application using Zend Framework 1.11.10. I have used this article
I am developing an application to manage a law office using zend framework 1.10,PHP
I am developing a web application with Zend Framework, and I am using JQuery
I'm developing a web application using Zend Framework 2 which will be made of
I am developing the application of login using facebook in Zend Framework. I done
I'm developing an application using the WAF (WPF Application Framework) which is based on
I am developing an application using WPF to dynamically render content, including text and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.