Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. <form method="POST" id="form_property" enctype="multipart/form-data">
  2. <div class="row">
  3. <div class="span4" id="image">
  4. <h3><strong>4.</strong> <span>Add Images to your Property (Maximum : 6 Images)</span></h3>
  5.  
  6. <div id="clone_image" class="fileupload fileupload-new ">
  7. <label class="control-label">Image file</label>
  8. <div class="input-append">
  9. <div class="uneditable-input"> <i class="icon-file fileupload-exists"></i>
  10. <span class="fileupload-preview"></span>
  11.  
  12. </div> <span class="btn btn-file">
  13. <span class="fileupload-new">Select file</span>
  14. <span class="fileupload-exists">Change</span>
  15.  
  16. <input type="file" name="files1" accept="image/*" />
  17. </span>
  18. </div>
  19. </div>
  20. </div>
  21. <!-- /.span4 -->
  22. </div>
  23. <!-- /.row -->
  24. <br/> <a id="another_image" class="btn btn-primary btn-small list-your-property" href="">Add Another Image</a>
  25. <br/>
  26. <br/>
  27. <input type="submit" name="submit" value=" Save images " class="btn btn-primary btn-large" style="float: left; width: 370px; height: 50px; margin-top: 10px">
  28. </form>
  29.  
  30. $(document).ready(function(){
  31.  
  32.  
  33. var count = 2;
  34. $('#another_image').click (function(){
  35. var clonedEl = $('#clone_image').first().clone()
  36. clonedEl.find(':file').attr('name','files'+count)
  37. if(count < 7){
  38. if(count == 6){ $('#another_image').hide();}
  39. $(clonedEl).appendTo("#image");
  40. count++;
  41. }
  42. });
  43. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement