Prev: errore
Next: Onmouseup in select box affects scrollbars
From: lale.kat on 28 Nov 2007 01:16 Hi.I want to change the text of browse button in file upload control in firfox,for example insted of being "browse" be "upload file", how can I do that? Is it possible ?I found a code that only works in IE but it doesent work in fireFox, I want to work in both of them. <html> <head> <title>File Upload Example</title> <script language="JavaScript" type="text/javascript"> function HandleFileButtonClick() { document.frmUpload.myFile.click(); document.frmUpload.txtFakeText.value = document.frmUpload.myFile.value; } </script> </head> <body> <form name="frmUpload" encType="multipart/form-data"> <!-- Real Input field, but hidden--> <input type="file" name="myFile" style="display: none"> <!-- 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" > </form> </body> </html> -----------------
From: Steve Swift on 28 Nov 2007 02:14 lale.kat(a)gmail.com wrote: > Hi.I want to change the text of browse button in file upload control > in firfox,for example insted of being "browse" be "upload file", how > can I do that? They've gone to a lot of trouble to stop me using the mechanism you're looking for to build a website that tells you to enter the file containing all your bank details then pressing the "Encrypt" button. -- Steve Swift http://www.swiftys.org.uk/swifty.html http://www.ringers.org.uk
From: Randy Webb on 28 Nov 2007 02:25 lale.kat(a)gmail.com said the following on 11/28/2007 1:16 AM: > Hi.I want to change the text of browse button in file upload control > in firfox,for example insted of being "browse" be "upload file", how > can I do that? You can't. > Is it possible? No. > I found a code that only works in IE but it doesent > work in fireFox, I want to work in both of them. Save yourself a lot of headaches and give up now. -- Randy Chance Favors The Prepared Mind comp.lang.javascript FAQ - http://jibbering.com/faq/index.html Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
From: VK on 28 Nov 2007 10:11 On Nov 28, 10:25 am, Randy Webb <HikksNotAtH...(a)aol.com> wrote: > lale....(a)gmail.com said the following on 11/28/2007 1:16 AM: > > > Hi.I want to change the text of browse button in file upload control > > in firfox,for example insted of being "browse" be "upload file", how > > can I do that? > > You can't. > > > Is it possible? > > No. What use to hide a secret if it's on the Internet? If IE/Gecko decides that it is a security flaw then let them fix it. http://www.quirksmode.org/dom/inputfile.html
From: Kailash Nadh on 28 Nov 2007 10:44
On Nov 28, 6:16 am, lale....(a)gmail.com wrote: > Hi.I want to change the text of browse button in file upload control > in firfox,for example insted of being "browse" be "upload file", how > can I do that? > Is it possible ?I found a code that only works in IE but it doesent > work in fireFox, I want to work in both of them. > > <html> > <head> > <title>File Upload Example</title> > <script language="JavaScript" type="text/javascript"> > function HandleFileButtonClick() > { > document.frmUpload.myFile.click(); > document.frmUpload.txtFakeText.value = > document.frmUpload.myFile.value; > } > </script> > </head> > <body> > <form name="frmUpload" encType="multipart/form-data"> > <!-- Real Input field, but hidden--> > <input type="file" name="myFile" style="display: none"> > <!-- 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" > > </form> > </body> > </html> > ----------------- It is not possible to tamper with the Browse button for security reasons. But if you are that desperate, well, you could try using a Flash to upload files :) http://www.flash-db.com/Tutorials/upload/upFiles.php -- Kailash Nadh | http://kailashnadh.name |