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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:05:48+00:00 2026-06-09T21:05:48+00:00

I’ve got a basic form setup for user input (first name, last name, email).

  • 0

I’ve got a basic form setup for user input (first name, last name, email). I’ve got jQuery and the validation plugin imported properly. My configuration for the validation is this:

$(document).ready(function() {
    $("#form").validate({meta: "validate"});
});

According to the documentation for the plugin that can be found here and here, this should mean I can add specifics to each input I want to validate. Thusly, I have this:

<input type="text" name="fn" value="" class="required" title="Please enter your first name." id="fn0">
<input type="text" name="ln" value="" class="required" title="Please enter your last name." id="ln1">
<input type="text" name="em" value="" class="{validate:{required:true, email:true, messages:{required:'Please enter your email address.', email:'Please enter a valid email address.'}}}" id="em2">

Each of these has it’s own label that I’ve omitted.

My CSS is setup like this:

label.error {
    color: red;
    font-weight: bold;
}

When on the form after clicking submit with all three fields blank, First Name and Last name show the red error messages as expected (Please enter your first name. and Please enter your last name. respectively. However, no error messages come up for the Email. If I put an invalid-formatted email address, I still receive no message. I’ve googled for a while and have read over the documentation, but I can’t seem to pinpoint where this might be failing.

Thanks

Note: IDs and Names have been editied for simplicity from my source code.

  • 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-06-09T21:05:49+00:00Added an answer on June 9, 2026 at 9:05 pm

    You probably just need to set the class as “required email” instead of the current validate options configuration. Here is the modified demo code that works for me:

    <input type="text" name="fn" value="" class="required" title="Please enter your first name." id="fn0">
    <input type="text" name="ln" value="" class="required" title="Please enter your last name." id="ln1">
    <input type="text" name="em" value="" class="required email" id="em2">
    

    The javascript and css remain the same.

    <script type="text/javascript">
    $(document).ready(function() {
        $("#form").validate({meta: "validate"});
    });
    </script>
    <style type="text/css" media="screen">
        label.error {
        color: red;
        font-weight: bold;
    }
    </style>
    

    Validation rules are run for each class set for the form field and a standard error for each rule will be displayed. In this example, first the “required” rule is run and displays the error saying “This field is required” and once the field is not empty, “email” validation rule is run till the field value matches email format tested by the rule.

    If you want more control on the error messages, you can pass more configuration in “validate” function call like this:

    $("#form").validate({
           rules: {
             fn: "required",
             ln: "required",
             em: {
               required: true,
               email: true
             }
           },
           messages: {
             fn: "Please specify your first name",
             ln: "Please specify your last name",
             em: {
               required: "We need your email address to contact you",
               email: "Your email address must be in the format of name@domain.com"
             }
           }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to clean up various Word 'smart' characters in user input, including but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
i got an object with contents of html markup in it, for example: string

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.