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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:21:39+00:00 2026-05-25T17:21:39+00:00

Hi i am currently doing a school project using cakePHP. I have the following

  • 0

Hi i am currently doing a school project using cakePHP. I have the following form and assume that the form tag is created.

<?php echo $form->input('number',array('id'=>"number",'title'=>"Please enter a number with at least 3 and max 15 characters ha!"));?>

<?php echo $form->input('secret',array('id'=>"secret"));?>

<?php echo $form->input('math',array('id'=>"math",'title'=>"Please enter the correct result!"));?>

 <?php echo $form->input('userName',array('id'=>"userName",'title'=>"User Exist"));?>

I am using a client side validation and here is the code that:

$.validator.addMethod("buga", function(value) {
    return value == "buga";
}, 'Please enter "buga"!');

// this one requires the value to be the same as the first parameter
$.validator.methods.equal = function(value, element, param) {
    return value == param;
};

    $().ready(function() {
    var validator = $("#texttests").bind("invalid-form.validate", function() {
        $("#summary").html("Your form contains " + validator.numberOfInvalids() + " errors, see details below.");
    }).validate({
        debug: true,
        errorElement: "em",
        errorContainer: $("#warning, #summary"),
        errorPlacement: function(error, element) {
            error.appendTo( element.parent("td").next("td") );
        },
        success: function(label) {
            label.text("ok!").addClass("success");
        },
        rules: {
            "data[User][number]": {
                required:true,
                minlength:3,
                maxlength:15,
                number:true 
            },
            "data[User][secret]": "buga",
            "data[User][math]": {
                equal: 11   
            }
        },
                    submitHandler: function(form) {
                        form.submit();
                    }


    });

});

The above only does client side validation can do for the first three inputs but my last input for this case may require to check the username is unique. How am i able to do the ajax call to the server? I am just confused in that part. Hope someone can guide me.

  • 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-25T17:21:40+00:00Added an answer on May 25, 2026 at 5:21 pm

    jQuery validate has a specific rule for server side validation (remote)

    http://docs.jquery.com/Plugins/Validation/Methods/remote#options

    The page above contains all of the information you need to make the request, the second example is pretty much your use case.

    The remote script should return only text, either true or false.
    See this page:

    http://jquery.bassistance.de/validate/demo/milk/

    open up your firebug/chrome console and look at the request after you fill in an email address and click submit.

    Good luck with your project.

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

Sidebar

Related Questions

I am currently doing a CRUD project for school and basically they want us
I'm currently doing a steganography project (for myself). I have done a bit of
I'm currently doing an academic benchmark, TPC-H, and I have some big tables that
I'm currently doing the following to use typed datasets in vs2008: Right click on
I am currently doing some socket programming using C/C++. To be able to use
I am currently doing a code review and the following code made me jump.
As I am currently doing this project in only C, I've up untill this
I've written a simple string tokenizing program using pointers for a recent school project.
I'm currently running a Django project on my school's webserver with FCGI. I did
I'm currently doing this: NSMutableDictionary *dict = [[NSDictionary alloc] initWithContentsOfURL: [NSURL URLWithString:@http://mysite/mypage.php]]; Which is

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.