0

Instead of using input type file for fileupload, I want to use a clickable div that calls the normal fileupload like the input did.

instead of this
<input type="file"/> 

I want this
<div>Click to upload</div>
and paste the file path in the div
3
  • "and paste the file path in the div" what does that mean? Commented Apr 22, 2012 at 3:41
  • This fiddle might help you Commented Apr 22, 2012 at 3:55
  • Yeah I don't really get the question either. Maybe he wants to pass the input file name and replace the divs contents with that path? Commented Apr 22, 2012 at 4:04

1 Answer 1

1

idea:

When the user click the div, call the click event on the file input and when it change, insert the html on the div

on the div

 $('#magicdiv').click(function(){
 $('#leupload').click();
  });

on the upload file

$('#leupload').change(function(){
$('#magicdiv').html( $(this).val() );
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.