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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:09:44+00:00 2026-06-04T12:09:44+00:00

I am trying to validate my form using jquery but I cannot get it

  • 0

I am trying to validate my form using jquery but I cannot get it work. When I click on submit it doesn’t show any error message.

Could you please tell me where is the problem?

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
 <script type="text/javascript" src="validation.js"></script>

 <script>
 $(document).ready(function() { 
// validate signup form on keyup and submit 
var validator = $("#signupform").validate({ 
    rules: { 
        fname: "required", 
        lname: "required", 
        username: { 
            required: true, 
            minlength: 2, 
            remote: "<? echo base_url();?>mycontroller/function" }
       }, 
    messages: { 
        fname: "Enter your firstname", 
        lname: "Enter your lastname", 
        username: { 
            required: "Enter a username", 
            minlength: jQuery.format("Enter at least {0} characters"), 
            remote: jQuery.format("{0} is already in use") 
        }, 

    }, 



}); 

</script>

My FOrm

 <!--I am trying to show all the error message here --> 

<form id="signupform" autocomplete="off" method="get" action="">

 FName:
 <input id="fname" name="fname" type="text" value="" />
 Lname:
 <input id="lname" name="lname" type="text" value="" />
 username:
 <input id="username" name="username" type="text" value="" />   <br>      

 <input id="signupsubmit" name="signup" type="submit" value="Signup" />          
 </form>            
  • 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-04T12:09:46+00:00Added an answer on June 4, 2026 at 12:09 pm

    as i mentioned in the comments it working in the fiddle

    make sure the scripts are loaded you can try using the cdn hosted version of jquery and validate.js

    jquery cdn

    http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js

    validate.js cdn

    http://ajax.aspnetcdn.com/ajax/jQuery.Validate/1.6/jQuery.Validate.js

    if it works with this it means that the scripts are not loaded and check your links

    EDIT

    $(":submit").click(function(e){
    
        if(!$(this).closest("form").valid()){
            e.preventDefault();
            var errText="";
            $(".error").each(function(i,j){
             errText+=$(j).text()+"<br/>";           
            });
            $("#errDiv").html(errText).css({color:'Red'});  
    
            }
    
    });
    

    http://jsfiddle.net/85DM4/17/

    its not comma separated but i’m sure you will get the idea

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

Sidebar

Related Questions

I'm trying to validate my php form using exception, but somehow it doesn't work.
I am trying to validate a form, using jQuery validate and show errors messages
I'm trying to get the height of the error container when using 'jquery validate'
While trying to validate form data on my page i get the following error:
I have a jQuery Dialog form and on submit I'm trying to validate the
I have a form dynamically created using Jquery and i am trying to validate
I'm trying to validate a form using the validate plugin for jquery. I want
Trying to get this form to validate email using the function the professor said
I'm trying to validate a form using jquery validate plugin and I'm having a
i am trying to validate a form text box using jquery validator, it works

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.