469,160 Members | 2,075 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,160 developers. It's quick & easy.

Custom HtmlInputFile


Hi, I want to customize the HtmlInputFile. I wanna something like an image
button to play the "browse" button hole and hide the textbox. Is that
possible?

I also have tried to hide an HtmlInputFile in my page and added some
javascript code to a button to fire the click() event of the HtmlInputFile.
It worked for a moment, but when the submit button is clicked the
HtmlInputFile looses its value. This solution was described in the
following link: http://p2p.wrox.com/topic.asp?TOPIC_ID=4772

Thanks

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #1
2 1524
> Hi, I want to customize the HtmlInputFile. I wanna something like an image
button to play the "browse" button hole and hide the textbox. Is that
possible?
Nope.
I also have tried to hide an HtmlInputFile in my page and added some
javascript code to a button to fire the click() event of the
HtmlInputFile.
It worked for a moment, but when the submit button is clicked the
HtmlInputFile looses its value. This solution was described in the
following link: http://p2p.wrox.com/topic.asp?TOPIC_ID=4772
I copied the exact code that was on that page, and added another button
called "Display" that calls a function that puts up an alert box with the
value of the hidden file upload element. When I clicked the "Upload File"
button, I got the dialog box, selected a file, and saw the value in the text
box. I then clicked the "Display" button, and saw the same value from the
hidden file upload element.

Conclusion: You did something wrong. What, I don't know.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
Neither a follower nor a lender be.

"Augusto Cesar via DotNetMonster.com" <fo***@DotNetMonster.com> wrote in
message news:b4******************************@DotNetMonste r.com...
Hi, I want to customize the HtmlInputFile. I wanna something like an image
button to play the "browse" button hole and hide the textbox. Is that
possible?

I also have tried to hide an HtmlInputFile in my page and added some
javascript code to a button to fire the click() event of the
HtmlInputFile.
It worked for a moment, but when the submit button is clicked the
HtmlInputFile looses its value. This solution was described in the
following link: http://p2p.wrox.com/topic.asp?TOPIC_ID=4772

Thanks

--
Message posted via http://www.dotnetmonster.com

Nov 19 '05 #2

Thanks for your reply.

The problem with that code is when you have to do something in the server
side. Try to put a button that submits to the server, like an asp:button,
to make the upload of the selected file. After you select the file, the
button doen't submit to the server and clear the value of the HtmlInputFile
when clicked.
In the client side it is all OK with that code, but I can't get the
selected file in the server side.

I will apreciate if somebody suggest another way to do that.

--
Message posted via http://www.dotnetmonster.com
Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Newbie | last post: by
2 posts views Thread by Skwish | last post: by
5 posts views Thread by Ariel Dolan | last post: by
3 posts views Thread by UJ | last post: by
7 posts views Thread by Buddy Ackerman | last post: by
reply views Thread by AndrewF | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.