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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:53:10+00:00 2026-05-27T05:53:10+00:00

I have just begun to work with the jquery validate plugin but have not

  • 0

I have just begun to work with the jquery validate plugin but have not been able to make it work as expected.

I have an example up on Fiddle located at http://jsfiddle.net/GWABv/3/

Can anyone tell me what the heck I am doing wrong? I am merely trying to require that the user select an option in the dropdown list, but even when I don’t select a value, it comes back saying that the form is valid.

HTML:

<form id="roadForm" method="get" action="">
    <p>
        <label for="editRoad_ProjectClassification">
            <em class="red">*</em> Project Classification:
        </label>
        <select id="editRoad_ProjectClassification" name="editRoad_ProjectClassification"  title="Please select something!" validate="required:true">
            <option value="">Please select</option>
            <option value="1">1</option>
            <option value="2">2</option>
        </select>
    </p>
</form>
<label class="FUNC_saveRecord">
    <span class="icon iconSave"></span>
    <span class="title">Save</span>
</label>

JavaScript:

$('.FUNC_saveRecord').click(function() {
    saveRecord();
});


function saveRecord() {
    var roadFormValidator = $('#roadForm').validate();
    if (!roadFormValidator.valid()) {
        roadFormValidator.showErrors();
    }
    else {
        alert('form is valid');
    }
}
  • 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-27T05:53:11+00:00Added an answer on May 27, 2026 at 5:53 am

    You have a few problems here:

    1. form is misspelled in the opening tag (<focm>) Looks like this was fixed
    2. You need to add a class='required' attribute to the field. validate=required:true won’t do it.
    3. You don’t need to call validate every time a click occurs. Just calling it once on document.ready will suffice.
    4. No need to manually call showErrors in this case. The plugin will do this for you automatically.

    Here’s how I would update your code:

    HTML:

    <form id="roadForm" method="get" action="">
    <p>
        <label for="editRoad_ProjectClassification">
            <em class="red">*</em> Project Classification:
        </label>
        <select id="editRoad_ProjectClassification" name="editRoad_ProjectClassification"  title="Please select something!" class="required">
            <option value="">Please select</option>
            <option value="1">1</option>
            <option value="2">2</option>
        </select>
    </p>
    </form>
    <label class="FUNC_saveRecord">
        <span class="icon iconSave"></span><span class="title">Save</span>
    </label>
    

    JavaScript:

    $("#roadForm").validate();
    
    $('.FUNC_saveRecord').click(function() {
        saveRecord();
    });
    
    
    function saveRecord() {
        var roadFormValidator = $('#roadForm');
        if (roadFormValidator.valid()) {
            alert('form is valid');
        }
    }
    

    Updated example: http://jsfiddle.net/hRjJM/

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

Sidebar

Related Questions

I have just begun working on a project which uses Mercurial as a version
I have just begun working with the Android SDK and I am having problems
I have just begun to use Visual Studio Team System 2008 Database Edition. I'm
I've just begun learning Silverlight (though I have 3 years C# experience). I'm trying
I've just begun to explore the TPL and have a design question. My Scenario:
I've just recently begun to use markdown and have noticed that any markdown within
I don't know if this is the correct website, but you guys have been
Just started with JavaCC. But I have a strange behaviour with it. I want
I have just begun experimenting with the DotNetOpenAuth project. Modifying the sample OpenIdRelyingPartyMvc project,
I've just begun to work with Require.JS and I'm a bit unclear on 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.