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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:45:06+00:00 2026-05-24T07:45:06+00:00

How can we validate the below code ? I want validate the input named

  • 0

How can we validate the below code ?
I want validate the input named software_name not be null. how to write the code?
the validation rules looks only support single input.

<input name="software_name[]" type="text" class="input_txt_l software-name" value="" />
<input name="software_name[]" type="text" class="input_txt_l software-name" value="" />
<input name="software_name[]" type="text" class="input_txt_l software-name" value="" />
<input name="software_name[]" type="text" class="input_txt_l software-name" value="" />

============================update at 2011/07/26========================

I can’t understand your help, I think I explain not clearly.try again.

I use this validation for form validate. http://bassistance.de/jquery-plugins/jquery-plugin-validation/

when we validate single input , we can use this to validate the name element.
html code:

<form action="url/saved" method="post" id="server-form">
    Name:<input name="name" type="text" class="input_txt" value=""/>    
</form>

javascript code:

var v = $('#server-form').validate({
        rules:{
            name:{
            required:true,
            minlength:2,
        maxlength:64
            }
        },
        messages:{
            name:{
            required:'can not be null',
            minlength:"too short",
        maxlength:"too long"
            }

        },

        onfocusout: function(element) {
        if ( !this.checkable(element)) {
            this.element(element);
        }
        },

        errorPlacement: function(error, element) {
            $(element).setValidateError({
        errorBox:error
            });
        },

        success: function(element) {
            $(element).setValidateOK();
    }

    });

but when we use form array. like this

<input name="software_name[]" type="text" class="input_txt_l software-name" value="" />

the jquery-validation-plugin looks not support . Am I right?

the only way looks likes @rharshath said ?

$('.software-name').each(function(i, $input) {
    if( $.trim($input.val()) == "" ) {
        // go nuts - alert it, or highlight that field, 
        // or put a tooltip beside it - whatever.
    }
});

we have to hack it by myself ?

  • 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-24T07:45:07+00:00Added an answer on May 24, 2026 at 7:45 am

    Follow the below steps.

    1) Open jquery.validate.js file
    2) Find checkForm: function() {
    3) Replace this function with below code.

    checkForm: function() {
        this.prepareForm();
        for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
            if (this.findByName( elements[i].name ).length != undefined && this.findByName( elements[i].name ).length > 1) {
                for (var cnt = 0; cnt < this.findByName( elements[i].name ).length; cnt++) {
                        this.check( this.findByName( elements[i].name )[cnt] );
                }
            } else {
                this.check( elements[i] );
            }
        }
        return this.valid();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using below code snippet to validate my input string with: only capital
I want to write a function which can validate a given value (passed as
I have some very simple code below that I can't get to validate on
I am using the below code to validate a user's input: function validateAddress(){ //if
Actually, I want to validate the Canadian postal code form field using jQuery validation.
How can I validate user input contain only 5 digits with 2 decimal. I
How can I validate the user input by using scanf. Right now I have
How can I validate a string using Regular Expressions to only allow alphanumeric characters
How can I validate an XML document against a DTD file which only my
What is a good regular expression that can validate a text string to make

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.