1

I have a problem to insert the calendar icon in the input field, the function need when the calendar icon is clicked then the date will show in the input field. Below is my sample coding:


<input type="text" class="form-control datepicker" id="document_date" name="document_date" value="" data-date-format="yyyy-mm-dd" readonly><br>

The output like below the picture:

output

Actually, I want the output like below the picture. It can click the calendar icon then choose the date will show in the input field:

output 2

Hope someone can guide me on how to solve it. Thanks.

2
  • what calendar library do u use? also add your code with icon Commented Dec 8, 2020 at 9:06
  • @לבני מלכה fa fa-calendar Commented Dec 8, 2020 at 9:12

1 Answer 1

0

You can use something like this (Bootstrap):

<div class="input-group mb-3">
  <div class="input-group-prepend">
    <span class="input-group-text" id="basic-addon1">@</span>
  </div>
  <input type="text" class="form-control" placeholder="Username" aria-label="Username" aria-describedby="basic-addon1">
</div>

And For Icons you can use for example font awesome.

Not the answer you're looking for? Browse other questions tagged or ask your own question.