Changing BROWSE... text from file class form ...

A

Anonymous

Guest
does anybody know how to change [BROWSE...] text from a File Class form ?

Code:
  <input type="file" name="F1" size="20">
 
I don't believe there is a way. It's something that is rendered by the browser specifically.
 
yes I think the same actually

but is there any way to make our own browse button for a textbox ?
My plan is to make an upload page , so I have to have a textbox
and a button which browses the files for that textbox ...
but I like to show another text instead of BROWSE... in that
button , so maybe I can use a normal button to do that ?
is there any way , maybe using JavaScript or something
that works in INTERNET EXPLORER and NETSCAPE ...

Best regards
 
well
Ive found a way to do it ...

Code:
<html>
<head></head>
<body>
<form name="test_form" method="post" action="test.jsp">
<input type=file name=browse style="display: none;" size="20">
<input type=text name=file size="20">
<input type=button
       style="font-style:veranda; font-size:12px; font-weight:bold;text-transform:lowercase;color:white;background-color:#A2C382;height:22px;border-style:ridge;text-align:center;"
       onClick="browse.click();file.value=browse.value;"
       value="Select a File...">        
<br><br>
<input type=submit
       value="Submit The Form Now!"
       style="font-style:veranda; font-size:12px;">      
</form>
</body>
</html>

this code even changes the button color and style ;)
Thanx
 
:shock:
Neat !
Cause this line doest work in Netscape :

Code:
browse.click();

:eek:
 
easy...
use this..
Code:
document.forms['test_form'].elements['browse'].click();

And don't forget to add quotes to attribute values
 
Thank you very much for your answer ...
but it still doesnt work in NETSCAPE (it works in IE) ...

here is my code :

Code:
<html>
<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>
<body>

<form name="test" method="POST" enctype="multipart/form-data" action="--WEBBOT-SELF--">
  <p>
    <input name="browse" type="file" name="F1" size="20">
  </p>
  <p>
    <input type="button" onclick="document.forms['test'].elements['browse'].click();" value="Click Browse ..." name="B1">
  </p>
</form>

</body>
</html>

Is there anything wrong with my code ?
 
Apart from the fact that it's FrontPage-generated, doesn't declare a doctype, and won't validate? I don't think so.
 
what version of netscape are you using.... ?
The thing I gave u is in the Javascript 1.3 reference manual... !
 
I am using Netscape version 7.1
but if there is a code depends on the version
of browser , I will drop it anyway
cause I will have hundred of users and I cannot
tell them to use a special version of a browser !
but thanx for help :)

finally I divide them into t different codes ...
one for Internet Explorer
and another one for other browsers ...
so if somebody browse this upload page with IE
he can see its difference , otherwise Ive used the
normal code.

now I have a new problem which I like to solve ...
as you may know , I have this code now :

Code:
<html>
<head></head>
<body>
<form name="test_form" method="post" action="test.jsp">
<input type=file name=browse style="display: none;">
<input type=text name=file>
<input type=button
       style="font-style:veranda; font-size:12px; font-weight:bold;text-transform:lowercase;color:white;background-color:#A2C382;height:22px;border-style:ridge;text-align:center;"
       onClick="browse.click();file.value=browse.value;"
       value="Select a File...">        
<br><br>

<input type=submit
       value="Submit The Form Now!"
       style="font-style:veranda; font-size:12px;">      
</form>
</body>
</html>

it works fine , but I should clikc SUBMIT button twice to submit the form !!!!!!! any idea or any solution for this problem ?
:-o
 
Back
Top