Guest User

Untitled

a guest
Feb 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <form class="form-padding" method="post">
  2. <a href="#"><img src=".." id="image"></a>
  3. <input type="file" class="form-control" asp-for="ImageUrl" id="dp-upload" onchange="readURL(this);">
  4. <label asp-for="FirstName"></label>
  5. <input asp-for="FirstName" />
  6. <label asp-for="LastName"></label>
  7. <input asp-for="LastName" />
  8. <label asp-for="Address">Address</label>
  9. <input asp-for="Address" />
  10. <button type="submit">Add </button>
  11. </form>
  12. <script>
  13. function readURL(input) {
  14. if (input.files && input.files[0]) {
  15. var reader = new FileReader();
  16. reader.onload = function (e) {
  17. $('#image').attr('src', e.target.result);
  18. $('#dp-upload').attr('val', e.target.result);
  19. debugger
  20. }
  21. reader.readAsDataURL(input.files[0]);
  22. }
  23. }
  24.  
  25. <script>
Add Comment
Please, Sign In to add comment