jQuery validation - required working but accept not

后端 未结 3 1408
伪装坚强ぢ
伪装坚强ぢ 2021-01-05 17:33

im uploading an image and trying to validate it before with jquery. Here is my code:



        
3条回答
  •  悲&欢浪女
    2021-01-05 18:03

    The documentation states that the accept rule only accepts mime-types as an argument.

    If you wanted to accept all images then use image/*.

    If you want to accept only specific image types then you can specify multiple mime-types by separating them with a comma, e.g. image/pjpeg,image/jpeg,image/png,image/gif.

提交回复
热议问题