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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T05:55:02+00:00 2026-05-30T05:55:02+00:00

The jsFiddle: http://jsfiddle.net/hbrls/Snn87/12/ I have a verify code field: <input type=text id=verfy_code name=verfy_code class=required

  • 0

The jsFiddle: http://jsfiddle.net/hbrls/Snn87/12/

I have a verify code field: <input type="text" id="verfy_code" name="verfy_code" class="required" />

and the validation js is:

    $("#aspnetForm").validate({
            rules: {
                verfy_code: {
                    required: function(element) { return check_verfy_code(); }
                }
            },
            messages: {
                verfy_code: { required: "verify code not correct" }
            }
        });
    function check_verfy_code() {
        var flag = false;
        //some ajax to check if verfy_code equalto session["verfy_code"]
        //I've not implemented this, so this function will always return false
        return flag;
    }

The messages never show.

  • 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-30T05:55:03+00:00Added an answer on May 30, 2026 at 5:55 am

    Check the documentation for the required(dependency-callback) option:

    The function is executed with the element as it’s only argument: If it
    returns true, the element is required.

    You are always returning false, therefore the element is never required.

    If you return true from your function your dependency callback will work as you expect:

    function check_verfy_code() {
        var flag = true;
        //some ajax to check if verfy_code equalto session["verfy_code"]
        //I've not implemented this, so this function will always return false
        return flag;
    }
    

    Example: http://jsfiddle.net/jZjFq/

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

Sidebar

Related Questions

jsFiddle: http://jsfiddle.net/KUcrm/ I have this code: HTML <input id=Check1 type=checkbox name=ckbRG tabindex=1 checked /><label
I have a jsfiddle http://jsfiddle.net/4Pc4B/10/ . In the jsfiddle, type in a question in
In this jsFiddle http://jsfiddle.net/littlesandra88/RBU8K/ have I the following code function addRemove(id) { alert(1); $('#'+id).toggle(function()
If you look at this JSfiddle http://jsfiddle.net/littlesandra88/G3N4m/ you will see that I have input
I have the following code at JSfiddle: http://jsfiddle.net/ACG2D/ $(document).ready(function() { $('.testThis').click(function() { $('.regexValidation').each(function() {
I have this jsfiddle http://jsfiddle.net/fwQq4/19/ Here I have the wrapper class ( div.wrapper )
Here is the jsFiddle: http://jsfiddle.net/8dbQu/1/ In brief, I have such structure: <div class='content'> <div
Here is the JSfiddle: http://jsfiddle.net/buyC9/128/ I want to clear only the file upload field
I have some sort of elsif statment bug I can't find: My JSfiddle: http://jsfiddle.net/z3xV3/64/
JSFiddle: http://jsfiddle.net/QbyUR/ So, I have an empty TD, that I'm trying to remove the

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.