Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

input type=file question

 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I was just wondering what exactly happens when you click the browse button of input type=file??
i mean what event gets called.
is it possible to call this browse buttons click from some other elements onClick??

because the requirement is to implement the browse functionality without the browse button and the text box being displayed.

So please help out in explaining what happens when you click on the browse button and can it be trapped?
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file selection dialog is part of the file input type; it can not be separated from it. What good is selecting a file if you have no way of storing which file has been selected?
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my requirement here is different.
i need to do what i have mentioned in my last post.
so is there a way?

and can anyone explain what happens when you click the Browse button? i mean whats the event that is fired? can it be fired from somewhere else?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The file input has very high security restrictions on it since it can do some damage to your system by uploading sensitive documents.

Add event handlers to the tag and see what fires. Only suggestion I have.

Eric
 
Niki Nono
Ranch Hand
Posts: 256
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok based on the previous posts another question.
how do i call some elements onclick from some other element?

input type=button name=a on click="some function"

input type=button name=b on click="call a's onclick"

note that i dont want to call the function i want to call the event.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic