ruzD ruzD - 20 days ago 5
CSS Question

HTML & CSS - Change text value in input button

I'm trying to change the text value of the input button. I know to do it is the parameter value='' but in this case it doesn't working fine.

My code:



<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
<link href="assets/css/custom-sugar-style.css" rel="stylesheet">
<div class="container-fluid">
<div class="row">
<div class="col-md-12 text-center">
<img class="img-sugar" src="assets/images/SUGAR.png" />
<br>
<br>
<br>
</div>
</div>
<div class="row">
<div class="col-md-12 text-center">
<form action="shareimage.php" method="post">
<input class="button-camera" type="file" accept="image/*" capture="camera" value="Take a photo" />
</form>
</div>
</div>





Could you help me?

Thanks!

Answer
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
function HandleBrowseClick()
 {
var fileinput = document.getElementById("browse");
fileinput.click();
 }
function Handlechange()
 {
 var fileinput = document.getElementById("browse");
  var textinput = document.getElementById("filename");
  textinput.value = fileinput.value;
  }
</script>

 <input type="file" id="browse" name="fileupload" style="display: none"    onChange="Handlechange();"/>

 <input type="button" value="Take a photo" id="fakeBrowse"    onclick="HandleBrowseClick();"/>No file chosen
</body>
</html>

Try this technique and apply your css class in it.