Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
187
rated 0 times [  193] [ 6]  / answers: 1 / hits: 15619  / 12 Years ago, sat, january 19, 2013, 12:00:00

I have a simple profile page which has image and some information. This profile page is filled up with the information provided during registration.



What i want is to allow registered users to click on their upload image on their profile page and be able to replace with a new one.



I know how to handle this from the database side.



I need help on the html or the front end side. In the sense that how do i make image clickable to open the upload image window.


More From » php

 Answers
6

I think the simplest solution to this, is to place the actual file upload element in the offset of the page and then forward trigger the click to it when the user clicks on the profile image.



HTML:



<input id=profile-image-upload class=hidden type=file>
<div id=profile-image>click here to change profile image</div>


JS:



$('#profile-image').on('click', function() {
$('#profile-image-upload').click();
});


See my Fiddle: http://jsfiddle.net/L8xCb/3/


[#80760] Thursday, January 17, 2013, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
bruno

Total Points: 602
Total Questions: 100
Total Answers: 111

Location: Tajikistan
Member since Sun, Aug 29, 2021
3 Years ago
bruno questions
Sat, Jul 11, 20, 00:00, 4 Years ago
Sun, Jun 28, 20, 00:00, 4 Years ago
Thu, Mar 12, 20, 00:00, 4 Years ago
Thu, Feb 6, 20, 00:00, 4 Years ago
Sat, Aug 10, 19, 00:00, 5 Years ago
;