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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:30:41+00:00 2026-05-30T21:30:41+00:00

Today is my first attempt at using the jQuery Validation plugin. My form is

  • 0

Today is my first attempt at using the jQuery Validation plugin. My form is for validating GPS coordinates.

Here are my rules and messages:

$(document).ready(function() {
    // validate form when called
    var validator =$("#box-registration").validate({
        rules: {
            latitude: {
                min: 0,
                max: 90,
                number: true
                },

            longitude {
                min: 0,
                max: 180,
                number: true
                },

            geo_dms {
                min: 0,
                max: 59,
                number: true
                }
            },
        messages: {
            latitude: "Latitude must be between 0 and 90",
            longitude: "Longitude must be between 0 and 180",
            geo_dms: "Degree minutes and seconds must be between 0 and 59"
            }
        });
    });

Here is part of the form I am trying to validate. I am trying to apply validation to the elements “geo-lat-dd” and “geo-lon-dd”:

        <div id="geo-format-dd">
            <dl>
            <dt><label class="labelstandard">Latitude</label></dt>
            **<dd><input  id="geo-lat-dd" name="geo-lat-dd" type="text" class="latitude textinput100 nonewrow"/></dd>**
            <dd class="nonewrow">
                <input type="radio" name="latDD" id="latDDN" checked="checked" value="N" class="nonewrow" /><label class="nonewrow" for="latDDN">N</label>
                <input type="radio" name="latDD" id="latDDS" value="S" class="nonewrow" /><label class="nonewrow" for="latDDS">S</label>
            </dd>
            </dl>

            <dl class="newrow">
            <dt><label class="labelstandard">Longitude</label></dt>
            **<dd><input id="geo-lon-dd" name="geo-lon-dd" type="text" class="longitude textinput100 nonewrow" /></dd>**
            <dd class="nonewrow">
                <input type="radio" name="lonDD" id="latDDW" checked="checked" value="W" class="nonewrow" /><label class="nonewrow" for="lonDDW">W</label>
            </dd>
            </dl>
        </div>

The two elements have classes “latitude” and “longitude” applied, and my Validation plugin rules include those classes (there are also fields for degrees-minutes-seconds so I’m trying to re-use the classes instead of using IDs).

No error messages appear when I validate the form with values like 9999 in the fields. Using Firebug, I have stepped through and confirmed the validation code is running, but it returns no exceptions.

In the rules, I have also tried putting a dot in front of the selectors, which crashed the page, and also enclosing it in quotes with a period, like “.latitude”

Can someone please point me in the right direction to figure out what I’m doing wrong?

  • 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-30T21:30:43+00:00Added an answer on May 30, 2026 at 9:30 pm

    There are a few issues:

    1. You are calling validate on the selector #box-registration which doesn’t exist in your sample markup.
    2. Your rules options should be keyed on the form element names. The documentation isn’t clear on this; they seem to imply that the rules can automatically match base on class names, but I don’t think that can be done in the way you are attempting.
    3. Your JavaScript has some syntax errors. Specifically, you’re missing colons in the rules object.

    I’ve created this Fiddle to show validation working with these corrections.

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

Sidebar

Related Questions

Today is my first day using ASP.NET MVC, and I'm finding it very intriguing.
I tried using PHPDoc for the first time today and quickly ran into a
I have been using pil for the first time today. And I wanted to
First let me state, today is my first day using NSesrviceBus - so I
Im moving first steps today on GWT framework. I need to understand (using the
I must confess that today is my first day using either Sweave or LaTeX.
I am using my new mac for the first time today. I am following
I have been using @selector today for the first time and have not been
Today's my first day with Flex and FlashDevelop. In my ActionScript file, I have
I came across Side-by-side Assemblies for the first time today while trying to install

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.