Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

303
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda