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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:09:03+00:00 2026-05-24T06:09:03+00:00

Is it possible to have a jquery validation code on a form element directly

  • 0

Is it possible to have a jquery validation code on a form element directly inside the form element?

Example, say I have a textbox… Could I set it up like this…

<input type="submit" name="submit" validation="Here is where you place Jquery Validation Code that would execute onSubit of form">

I thought I saw that online some where while I was searching for something else… It would be great if you could do that, because it would really be what I need… Unfortunately, life is never so sweet…

But say you were generating your form elements on the fly, and you wanted each individual element to have a slightly different validation code to be run by jquery that would give you a false or a true if not met…
How would you manage to do that?

Thanks,
Derek

  • 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-24T06:09:03+00:00Added an answer on May 24, 2026 at 6:09 am

    I dont know about doing it like that but have you looked at this plugin: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ?

    Basicly, if you would have HTML like this:

    <p>
    <label for="firstname">Firstname</label>
    <input id="firstname" name="firstname" />
    </p>
    

    And the form this is in has id signupForm, you would just do this:

    $("#signupForm").validate({
        rules: {
            firstname: {
                required: true,
                minlength: 2
            }
        },
        messages: {
            firstname: {
                required: "Please enter your firstname",
                minlength: "Your firstname must consist of at least 2 characters"
            }
        }
    });
    

    Edited example with 2 rules. See the plugin documentation for details.

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

Sidebar

Related Questions

I have a form on my jQuery Mobile site that I would like to
I have a form that uses the excellent jQuery validation plugin. This is a
I have a form with several fields and using jQuery validation plugin. My input
Is it possible to have one jQuery ready block executed after all others have
Is it possible that using jQuery, I cancel/abort an Ajax request that I have
Hi I am using jquery 1.4.2 and jquery validate 1.7( http://bassistance.de/jquery-plugins/jquery-plugin-validation/ ) Say I
i'm using the validation plugin from http://docs.jquery.com/Plugins/Validation i'd like to know if it is
I'm using jQuery along with the jQuery validation plug-in. I have a table where
Two things: Is it possible to set the Page.IsValid (Is_Valid) property through Jquery so
I have a website with the following code for a specific element: <textarea id=textToTranslate

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.