0

I am trying to set no file chosen in upload file to a filename . How to set no file chosen to a file name. What I have tried is:

<input class="form-control" id="imgInp" type="file" accept=".png,.jpg,.jpeg" name="img" required> 

On load of a form , I am trying to set value of no file chosen to a filename

$('#imgInp').val('abcd.jpg');

Output

How to change no file chosen in file input?

CodeHunt
  • 83
  • 1
  • 11

1 Answers1

0

Easy Solution:

Add placeholder

<input class="form-control" id="imgInp" placeholder="no file chosen" type="file" accept=".png,.jpg,.jpeg" name="img" required> 
Wayne
  • 660
  • 6
  • 16