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

  • SEARCH
  • Home
  • 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 8504845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:09:00+00:00 2026-06-11T02:09:00+00:00

To start with, I tried to search on stackoverflow for the similar topic. I

  • 0

To start with, I tried to search on stackoverflow for the similar topic. I understand some similar posts got shut down because of there are answered posts for it already, which I don’t really find it’s helpful(here: zend form validation, maybe I am not clever enough), so please admin, allow this post to stay for a while>**

In my case, first I state the form in my controller:

        $this->_helper->layout->disableLayout();
    $form = new Zend_Form();
    $form->setAction('/user/login')
         ->setMethod('post');

    // Create and configure username element:
    $username = $form->createElement('text', 'username');
    $username->addValidator('alnum')
             ->addValidator('regex', false, array('/^[a-z]+/'))
             ->addValidator('stringLength', false, array(6, 20))
             ->setRequired(true)
             ->addFilter('StringToLower');

    // Create and configure password element:
    $password = $form->createElement('password', 'password');
    $password->addValidator('StringLength', false, array(6))
             ->setRequired(true);

    // Add elements to form:
    $form->addElement($username)
         ->addElement($password)
         // use addElement() as a factory to create 'Login' button:
         ->addElement('submit', 'login', array('label' => 'Login'));

Then I output in my view file:

<?php echo  $this->testForm;?> 

And we found some really cool Jquery plugin for form validator but I don’t see how it’s possibly I integrate it with the code in Zend Form. I try to refernce Zendx_Jquery, it seems that even doesn’t include a form-validation option.

Could anyone shred a light? Thanks.

PS, you might find in my code I already I have some params for validations, that’s not what I want, all I want for front-end using some jquery plugin for real-time input validation.

  • 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-11T02:09:01+00:00Added an answer on June 11, 2026 at 2:09 am

    To add jQuery validation you can add some decorators to form, example :

        $form->setName('postForm');
        $form->setMethod('post');
        $form->addDecorator('HtmlTag', array('tag' => 'div', 'class' => 'my-lovely-form'));
        $form->setAttrib('enctype', 'multipart/form-data');
    

    Then you do jQuery validation in View.phtml example:

    $('#postForm').validate({
                submitHandler: function(form) {
                    $("#submit").attr('disabled', 'disabled');
                    form.submit();
                },
                onchange: true,         
                errorLabelContainer: $('.error-container'),
                wrapper: "p",
                rules: {
                    name: {
                        required: true,
                        minlength: <?php echo $this->validationConfig->form->name->minlength; ?>,
                        maxlength: <?php echo $this->validationConfig->form->name->maxlength; ?>
                    },
                    title: {
                        required: true,
                        minlength: <?php echo $this->validationConfig->form->title->minlength; ?>,
                        maxlength: <?php echo $this->validationConfig->form->title->maxlength; ?>
                    }
                },
                messages: {
                    name: {
                        required: "Full name is required",
                        minlength: "Full name has to be at least <?php echo $this->validationConfig->form->name->minlength; ?> characters long",
                        maxlength: "Full name has to be less than <?php echo $this->validationConfig->form->name->maxlength; ?> characters long"
                    },
                    title: {
                        required: "Title is required",
                        minlength: "Title has to be at least <?php echo $this->validationConfig->form->title->minlength; ?> characters long",
                        maxlength: "Title has to be less than <?php echo $this->validationConfig->form->title->maxlength; ?> characters long"
                    }
                }
            });
    

    I hope this can help you.

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

Sidebar

Related Questions

I'm trying to work on a bmp file. For a start i tried to
After trying to figure out why a Capistrano task (which tried to start a
i run nexus-2.0.2 on linux, following nexus referrence, i tried to start up nexus,
I tried the following DateTime start = Convert.ToDateTime(TextBox1.Text); DateTime end = Convert.ToDateTime(TextBox2.Text); if (DateTime.Now.Date
First i couldn't start MSDTC service.I tried following link and solve that problem. link
I've tried getting the launch link from the start menu and using Process.Start() But
I've tried '--kiosk', '--start-maximized'; but all not work, any solution yet? Further, the web
I tried: final ProcessBuilder pb = new ProcessBuilder(umount, foldername); final Process p = pb.start();
Since a few days I'm unable to start resque I have tried debugging this
Hello dear users of the stackoverflow! I really like the search form on this

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.