0

I have create a form to edit the image and already get the data from database. But it doesn't have the initialize value of that slider.

Here is the code :

<fieldset class="form-group">
    <label for="formGroupExampleInput2">Upload image</label>
    <img src="<?=$value['slider_link']?>" alt="<?=$value['slider_name']?>" style="width: 90%;">
    <input name="file" type="file" class="form-control" id="file" value="<?=$value['slider_link']?>">
</fieldset>

theresult

As you can see, the image was loaded. But the value inside the input wasn't call. It suppose to have Database.png into the input.

How can I fix this?

5
  • file input will show name only when a file got selected by clicking browse button Commented Jul 24, 2019 at 9:53
  • You can't pre populate a file input fields value because of security reason, more. Commented Jul 24, 2019 at 9:55
  • so it is impossible right? Commented Jul 24, 2019 at 9:58
  • Yes it is impossible Commented Jul 24, 2019 at 9:59
  • You're welcome, you could also consider using this method instead Commented Jul 24, 2019 at 10:02

1 Answer 1

0

We can't initialized the input file. moreover you if you want the file name on submit you can store it onto the hidden variable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.