0

I have a file upload field in my form and I am validating that field using jquery validation like the following:

My Input tag:

<input type="file"  id="photo" name="photo" />

Validation:

    $('#create_teacher').validate({
    rules: {
        photo:{
            required: true,
             extension: "jpeg,jpg,gif,png"
        },
    },
    messages: {
        photo: { // <- this refers to the NAME attribute, NOT id.
            required: "this field is mandatory",
            extension: "accepts jpeg, jpg, gif or png"
        }
    }
  });

can anyone help me in this .

Raghavendra
  • 259
  • 4
  • 12
  • 23
  • Don't ask the same question twice? Also, this question doesn't have an actual question in it. – Ryley Mar 10 '14 at 15:24
  • possible duplicate of [Input file validation](http://stackoverflow.com/questions/22294479/input-file-validation) – Ryley Mar 10 '14 at 15:25

0 Answers0