0

How can I detect the action when clicking on the browse on this form?

<form action='#' enctype='multipart/form-data'>
    <input type='file' name='file'>  
</form>

I have another div and when I click on that div I want that the browse action will happen

3

2 Answers 2

0

check this fiddle, it is as simple as

$( "#file" ).click( function(){

   alert(1);

} );
Sign up to request clarification or add additional context in comments.

Comments

0

OK, I figured it out: When clicking on the div that I want to trigger it for example #my_div, The input class will be clicked

$("#my_div").click(function() {
    $("input_class").click();
})

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.