Click here to Skip to main content
15,894,343 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Here my code,

<input id="txtfile" type="file" />

And i want that user also can type a text in that textbox.In my scenario when cursor moves to
the textbox ("txtfile") in that file dialog box open.I want to avoid that the file dialog will
open only by clicking browse button.
Posted

1 solution

A html control of type "file" is displayed differently by every browser. So the way to go (I think) would be to add the file control and hide it. Then you could add a text box and a button and try to accomplish the same. Here is a jsfiddle that does just that!

http://jsfiddle.net/CcGrT/

But just curious, why do you want to do this? This just makes your life tougher, since you wouldn't know if anything entered is valid. So I would also disable the text box, leaving the button alone to be in the enabled state!

Hope this helps! If this is not what you're looking for pls. update your question!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900