0

Hi,
I am using jquery form validation and jquery multiple file upload script but I am having problem with it. My multiple upload script works like this

 <input type="file" name="userfile[]" size="20" class="multi MultiFile-applied" type="file" maxlength="5" accept="gif|jpg" />

and I dont want to apply jquery validation code on this field but I am getting this error." Please enter no more than 5 characters". How can I get rid of this error and my form validation for other fields is as follow

<script type="text/javascript">

    $().ready(function() {

        // validate signup form on keyup and submit
        $("#adForm").validate({
            rules: {
                name: "required",
                            first_name:"required",
                            last_name:"required",
                                 capacity:{
                                required:true
                            },

                phone: {
                    required: true,
                    minlength: 7

                },
                email: {
                    required: true,
                    email: true
                },



            },
            messages: {
                name: "Please enter name",
                            first_name:"Please enter first name",
                            last_name:"Please enter last name",

                price: {
                    required: "Please enter price"
                    },
                phone: {
                    required: "Please provide a phone"

                },
                email: "Please enter a valid email address"

            }
        });



    });

Can anyone help. Thanks in advance.

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by saadi06
0

But I have to keep maxlength attribute as in my multiple image upload script maxlenth controls the number of images and when I apply the maxlength attribute it starts giving me error is there any possible way to ignore the rule for this specific fields. thanks

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.