473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Browse button appearance in HTMLInputFile

Hi everyone,
I have been trying to change my browse button appearance displayed with my
HtmlInputFile control but without any success. The solution I tried was the
one discuss on this forum (http://p2p.wrox.com/topic.asp?TOPIC_ID=4772).
Here is my code:

<script language="JavaScript" type="text/javascript">
function HandleFileButtonClick()
{
document.frmUpload.myFile.click();
document.frmUpload.txtFakeText.value =
document.frmUpload.myFile.value;
}
</script>

<!-- Real Input field, but hidden-->
<input type="file" id="myFile" style="display: none" runat="server">
<!-- Fake field to fool the user -->
<input type="text" name="txtFakeText" readonly="true">
<!-- Button to invoke the click of the File Input -->
<input type="button" onclick="HandleFileButtonClick();" value="Upload
File" style="background: red;">
<asp:RequiredFieldValidator id="val_Input"
ControlToValidate="myFile" Display="Dynamic"
errormessage="Error" />

My problem is that my HTMLInputFile text is always empty and therefor, my
RequiredFieldValidator fells.

Any help, tips, code, other suggestions, site is greatly appreciated.

Jonathan
Nov 22 '05 #1
0 1360

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: robert | last post by:
hi! I want to have a custom button change appearance when pressed and then call a function and change back to its original appearance when released. here's what i have now, which works mostly....
7
by: Timothy Madden | last post by:
Hy all I have a form for uploading photos on a web page wich I need to translate in French. My problem is I have no ideea how to translate the Browse button of the <input type=file ...> element....
0
by: Jonathan | last post by:
Hi everyone, I have been trying to change my browse button appearance displayed with my HtmlInputFile control but without any success. The solution I tried was the one discuss on this forum...
3
by: Lāʻie Techie | last post by:
I'm having two troubles with the <button> tag in Internet Explorer on Windows (I don't have access to a Mac to test it). It works as expected in Mozilla both on Windows and Linux. Here is the...
1
by: Newbie | last post by:
i have a c# asp.net webform that has an HtmlInputFile and a listbox (to hold the filenames to be uploaded). but HtmlInputFile.PostedFile and HtmlInputFile.Value are readonly properties. i have to...
11
by: Mark Rae | last post by:
Hi, Is there any way to modify the style of the button portion of an HtmlInput control? I have a CSS class which I use for all of the buttons to try to make them a little less ugly than the...
3
by: UJ | last post by:
How can I add a browse button to my asp.net page? What I need is a button they can press that will then let them select the file to upload to the server. And if anybody has any good code on how...
7
by: Buddy Ackerman | last post by:
I created this class Public Class HTMLFileInput : Inherits System.Web.UI.HtmlControls.HtmlInputFile Public Property Data As String Get Return ViewState("HTMLFileInput.Data") End Get Set...
1
by: sham | last post by:
Hi to all, I have text box that is bound to a field in my datasource which contains a directory path. What I need is the ability to allow the user to press a browse button, which launches a...
0
by: gazza | last post by:
Hi, I have an application which shows a single record which has numerous image files stored. The images are displayed as thumbnails, and if I click on "Edit", an HtmlInputFile control is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, youll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.