jQuery validate upload only, if file chosen -
i'm using jquery validate plugin validate forms. 1 form there should optional upload field. rule
rules : { image_file : { accept: "image/*", } it automaticly required, if upload field left empty.
rules : { image_file : { accept: "image/*", } .... it automaticly required, if upload field left empty.
that's absolutely impossible code you've shown us.
demo: http://jsfiddle.net/agpwk0nv/1
it's have required attribute or class on input without realizing it.
<input type="file" name="image_file" required="required" /> or
<input type="file" name="image_file" class="required" /> if want "optional", you'll need remove required.
Comments
Post a Comment