0

Having form code to upload file in php,see code:

<html>
<body>

<form action="ok.php" method="get">
Name: <input type="ghf" name="str"><br>

<input type="submit">
</form>


</body>
</html> 

Check image:

enter image description here

But of we open this form in different browsers it saying as Browse in firefox and Choose file in Chrome(refer to image,on top is chrome,second is firefox) Question is i want to change name of this Choose file or Browse,is it possible?If yes how?

Alien
  • 3,658
  • 1
  • 16
  • 33

4 Answers4

0

Try this

<!DOCTYPE html>
<html>
<body>

<form action="upload.php" method="post" enctype="multipart/form-data">
    Select file to upload:
    <img src="/images/uploadButton.png" id="upfile1" style="cursor:pointer" />
    <input type="file" id="file1"  name="file1" style="display:none" />
    <input type="submit" value="Upload File" name="submit">
</form>
<!--Load jQuery from Google Libraries-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
    //Using jQuery
    $("#upfile1").click(function () {
        $("#file1").trigger('click');
    });
</script>

</body>
</html>
tzafar
  • 674
  • 3
  • 12
0

The input[type=file] is a native browser object and can't be changed within.

What you can try and do is create a custom wrapper.

JNF
  • 3,696
  • 3
  • 31
  • 64
0

Appearance of file type field is different with different browsers.

Default behavior of chrome does not display textbox and button for the file type fields.

You can refer this link for solution.

Bhavya Shaktawat
  • 2,504
  • 1
  • 13
  • 11
0

these are by Default button styles of submit button.

You can edit it either by adding this:

Value attribute is used to define names of button.

http://www.w3schools.com/tags/att_input_value.asp