Details |
Letzte Änderung |
Log anzeigen
| RSS feed
| Revision |
Autor |
Zeilennr. |
Zeile |
| 2 |
lars |
1 |
// Limit the number of files in a FileList.
|
|
|
2 |
$.validator.addMethod( "maxfiles", function( value, element, param ) {
|
|
|
3 |
if ( this.optional( element ) ) {
|
|
|
4 |
return true;
|
|
|
5 |
}
|
|
|
6 |
|
|
|
7 |
if ( $( element ).attr( "type" ) === "file" ) {
|
|
|
8 |
if ( element.files && element.files.length > param ) {
|
|
|
9 |
return false;
|
|
|
10 |
}
|
|
|
11 |
}
|
|
|
12 |
|
|
|
13 |
return true;
|
|
|
14 |
}, $.validator.format( "Please select no more than {0} files." ) );
|