Steffan A. Cline schrieb:
Would it be something like this in the head?

jQuery.validator.addClassRules({
    brochure: { accept: pdf },
    movie: { accept: mov|mpg|mpeg|fla|mp4 },
    photo: { accept: jpg|gif }
});

Then in the body?

<input type="file" name="somethingdynamic" class="photo" />
<input type="file" name="somethingdynamic" class="movie" />
<input type="file" name="somethingdynamic" class="brochure" />
That looks good. Details for addClassRules are here, in case you haven't been there yet: http://docs.jquery.com/Plugins/Validation/Validator/addClassRules#rules

That is handy for reusing rule combinations, and much easier to setup then custom methods.

Your example looks like you're missing a few quotes. The parameter to accept should be a string that becomes part of a regular expression: http://docs.jquery.com/Plugins/Validation/Methods/accept

Jörn

Reply via email to