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 6652991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:12:43+00:00 2026-05-26T01:12:43+00:00

I have created a zend form. I have added some elements. I have put

  • 0

I have created a zend form. I have added some elements. I have put validate attribute in all elements but validation in not working out.
Here is my code

  /* Form Elements & Other Definitions Here ... */
    $this->setMethod('post');
   $this->addElement('text', 'email', array(
       'required'   => true,
        'filters'    => array('StringTrim'),
        'validators' => array(
            'EmailAddress',
        )
    ));
   // Add the comment element
    $this->addElement('textarea', 'comment', array(
       // 'label'      => 'Please Comment:',
        'required'   => true,
        'validators' => array(
            array('validator' => 'StringLength', 'options' => array(0, 20))
            )
    ));

    // Add a captcha
    $this->addElement('captcha', 'captcha', array(
        //'label'      => 'Please enter the 5 letters displayed below:',
        'required'   => true,
        'captcha'    => array(
            'captcha' => 'Figlet',
            'wordLen' => 5,
            'timeout' => 300
        )
    ));

    // Add the submit button
    $this->addElement('submit', 'submit', array(
       'ignore'   => true,
        'label'    => 'Sign Guestbook',
    ));

    // And finally add some CSRF protection
    $this->addElement('hash', 'csrf', array(
        'ignore' => true,
    ));

Not even a single validation in working out. On my view I just echo the form object. Would any body tell me where Am I Wrong?

  • 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-05-26T01:12:43+00:00Added an answer on May 26, 2026 at 1:12 am

    Zend_Form is supposed to validate your input in the server side. To use it, you need to send the data to the server somehow, and then call $form->isValid($data).

    • The simple way would be just to submit the form, and validate the data in your action, there are some good tutorials about it, for instance this one: http://akrabat.com/zend-framework-tutorial/ .

    • If you want to leverage the validators but still want to get some validation feedback before submitting the form, you can also send the data through Ajax. The following tutorial tells you a nice way to do it using jQuery: http://www.zendcasts.com/ajaxify-your-zend_form-validation-with-jquery/2010/04/ . I followed it and it was quite good.

    In any case, keep in mind that the validation is always run in the server side.

    Hope that helps,

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

Sidebar

Related Questions

i have created a form with zend framework and this form have some elements
About to create a form using Zend Form, all the form elements should have
I have created one user_form class that extends zend form, it has 4 elements
I have a created a zend form, works fine along with validations. Is there
Server side extjs form validation using zend framework I have extended Zend_Form class to
hi i am using zend form , i created a Zend_Form_Element_Radio element that have
I created a zend form. I want to make a group of elements that
I have created new PDFs many times using Zend and PHP. But Now I
I have 2 text elements in a Zend form. When I add a Zend
I have created a form with zend form. I process the data in one

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.