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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:29:47+00:00 2026-05-27T12:29:47+00:00

I am trying to use jquery validator in a cakephp project.There is probem with

  • 0

I am trying to use jquery validator in a cakephp project.There is probem with jquery
I think,something wrong with selector id of my form..I can not even alert any message inside.
I am completely a fresher.

I used following code

$(document).ready(function(){        $('#UserQuickCompanyRegisterForm').validate({
       rules: {
            "data['User']['email']": {
               required: true,
               email: true
           }
        }
       });        });

and my form is like this.

echo $form->create('User', array('action' => 'quick_company_register','inputDefaults'=> array('label'=>false)));

and it outputs somthing like below.

<form id="UserQuickCompanyRegisterForm" accept-charset="utf-8" method="post" action="/cityportal/index.php/users/quick_company_register" novalidate="novalidate">.

what i am doing wrong…thanks in advance

  • 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-27T12:29:48+00:00Added an answer on May 27, 2026 at 12:29 pm

    its solved.I was making mistake with element id.Instead of id i used name attrbute.”Silly me”.After a ;ong fat burning hour i got thit following code wrking

    <script type="text/javascript">     $(function(){           $.validator.addMethod("alphanum", function(value, element) {
                return this.optional(element) || /^[a-z0-9/_]+$/i.test(value);
            }, "Username must contain only alphanumeric.");
    
           jQuery.validator.addMethod("exactlength", function(value, element, param) {       return this.optional(element) || value.length == param;        }, jQuery.format("Please enter exactly {0} characters.")); 
                 $('#UserQuickCompanyRegisterForm').validate({          debug: false,
           errorClass: "authError",
           errorElement: "span",
            rules: {    
                "data[User][username]": {
                   required: true,
                   alphanum: true,
                   minlength: 4,
                   maxlength: 30
               },
               "data[User][password]": {
                   required: true,
                   minlength: 6
               },
               "data[User][password1]": {
                   required: true,
                   equalTo: "data[User][password]"
               },
               "data[User][first_name]": {
                   required: true,
                   maxlength: 30,
                   alphanum: true
               },
               "data[User][second_name]": {
                   required: true,
                   maxlength: 30,
                   alphanum: true
               },
               "data[ZIP][zipcode]": {
                   required: true,
                   number:true, 
                    exactlength: 5
               },
    
                "data[User][email]": {
                   required: true,
                   email: true
               },
               "data[User][telephone]": {
                   number: true,
                   exactlength: 10
               }
           },
           highlight: function(element, errorClass) {
            $(element).removeClass(errorClass);
            }
           });        });
           </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use Jquery validator in my cakephp project.How can i impliment
I am trying to use jquery validator plugin and form submit via ajax in
All, I'm trying to use the jQuery Form Validator (http://docs.jquery.com/Plugins/Validation). However I'd like to
I'm trying to use the Jquery builtin validator on my page. The issue is
All, I am trying to use JQuery's URL Validator plugin. http://docs.jquery.com/Plugins/Validation/Methods/url I have a
I'm trying to use a custom validator with jQuery Validation plugin. However, I'm unsure
I am trying to use jquery validate plugin on my 5 questions quiz form.
I'm trying to use the jQuery Validation plugin to make a multistep form with
I'm trying to use unobstrusive validation with ASPNET MVC 3 project and placeHolder jQuery
I am using this jQuery form validation plugin: http://docs.jquery.com/Plugins/Validation/Methods I am trying to use

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.