4

How can I stop input type=file from opening 'file selection window' without disabling it? Any method I can try using jquery or javascript?

To reply the comments below:

Yes, this is not a mistake. I need this input file type. My situation here is that I want the user to select file once, after that, it will stop user from selecting again, but not disabling it.

2
  • 2
    What? Your question doesn't make sense. What is "open window"? Do you mean the file selection dialog? How to do you expect to get the file if the user can't pick it? Commented Oct 11, 2011 at 4:18
  • 2
    if you dont want the file open dialog to open why do you use it in the first place ... Commented Oct 11, 2011 at 4:23

1 Answer 1

1

js:

$file.click(function(event){ if (!theFirstClick) { event.preventDefault(); } ... }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.