davidlee
davidlee

Reputation: 6167

Stop input type file from opening 'file selection window'

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.

Upvotes: 4

Views: 3005

Answers (1)

JJin
JJin

Reputation: 27

js:

$file.click(function(event){
  if (!theFirstClick) {
    event.preventDefault();
  }
  ...
});

Upvotes: 1

Related Questions