Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > HTML > HTML Code Clinic
|
HTML Code Clinic Do you have some HTML code you'd like to share and get suggestions from others for tweaking or improving it? This discussion is the place.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the HTML Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2006, 03:35 AM
Authorized User
 
Join Date: Dec 2004
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default Change Caption HtmlInputFile but it doest not upl.

HI all

i have a problem please help me.
i have to change the caption of HtmlInputFile from browse to some thing another.i have get the solution but on serverside i didnot get any file upload. please help me
code is below
<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">

    <input type="file" name="myFile" style="display: none">

    <input type="text" name="txtFakeText" readonly="true">

    <input type="button" onclick="HandleFileButtonClick();" value="Upload File" style="background: red;">
  </form>
</body>
</html>

 
Old April 25th, 2008, 04:08 AM
Registered User
 
Join Date: Apr 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Israr,

Maybe you already now the solution. Anyway, your javascritp function must be:

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


Francisco Aragão,







Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VB : How to change Label Caption papanchal Excel VBA 1 September 22nd, 2008 04:46 PM
Php page doest not display anything urtrivedi Beginning PHP 2 November 9th, 2007 02:38 AM
Change button caption on continuous subform PeregrinTook Access VBA 2 April 16th, 2007 05:16 PM
Change Caption HtmlInputFile Israr ASP.NET 1.0 and 1.1 Professional 4 November 8th, 2006 02:32 AM
HtmlInputFile g_vamsi_krish ASP.NET 1.0 and 1.1 Basics 2 July 25th, 2006 06:40 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.