mardi 4 août 2015

how to control multiple uploads to count 5

I want to upload images for adding property and have some code in which i am able to add more than 5 file uploads. How can stop the uploads at five. here is the sample code i am using

<form enctype="multipart/form-data" action="" method="post">
<div id="filediv"><input name="file[]" type="file" id="file"/></div><br/>
<input type="button" id="add_more" class="upload" value="Add More Files"/>
<input type="submit" value="Upload File" name="submit" id="upload" class="upload"/>
</form>

and the js code for add button is

$('#add_more').click(function() {
$(this).before($("<div/>", {id: 'filediv'}).fadeIn('slow').append(
$("<input/>", {name: 'file[]', type: 'file', id: 'file'}),        
$("<br/><br/>")
));
});

how can i stop add more button can be available for only five.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire