473,511 Members | 16,260 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1373

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

Similar topics

1
2821
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
7370
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
381
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
2708
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
2114
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
1794
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
1815
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
1746
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
1205
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
1146
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
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7353
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5662
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3212
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.