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.
") )); }else{ alert("Can not add more then 5") } count++; }); – Dharmendra Aug 04 '15 at 12:37