Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
Trigger Chrome and Edge native datepicker by clicking anywhere in input

Date picker that can only be clicked on icon

Clicking on the circled icon brings up the date picker for Chrome and Edge, but my computer illiterate test users don't know where to click and complain it doesn't work.

Is there a way to make the date picker show up when clicking anywhere on the input box?

I have tried the method outlined here, but it doesn't work. I am using the latest Chrome/Edge Browser and Bootstrap 4.6.

Here is the HTML for my input field:

<div class="form-group col-md-3 col-sm-12">
   <label class="control-label" for="Date">Date:</label>
   <input id="Date" type="date" class="form-control picker" name="Date" value="" />
</div>

Many thanks to Firefox for doing this by default.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I could not trigger the calender from js (my original thought), so I made a (hacky) solution where I use css to resize the calendar target area and then place it over the entire input area. scaleX(-1) is to flip it so the calendar icon stays on the left. I put a red border around the calendar area so you can see it.

<html>
  <head>
    <style>
      #Date::-webkit-calendar-picker-indicator {
        position: absolute;
        left: 50;
        transform:scaleX(-1);
        top: 10px;
        width: 95px;
        margin: 0;
        padding: 0;
        cursor: pointer;
        border: 1px solid red;
      } 
    </style>
  </head>
  <body>
    <div class="form-group col-md-3 col-sm-12">
      <label class="control-label" for="Date">Date:</label>
      <input id="Date" type="date" class="form-control picker" name="Date" value="" />
    </div>
  </body>
</html>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!