You can block the Arrow from the DATE field

Asked

Viewed 448 times

4

inserir a descrição da imagem aqui

Would there be some way to block that little arrow there ?

  • 1

    This seems to be javascript, can put the code that generates this input.

  • Yes, changes the type input. You probably have a input type="date" mute to input type="text" and puts a datepicker.

1 answer

5


Are you looking for webkit-inner-spin-button. Even you can disable the Calendar Picker if you like. About the use of ::placeholders be supported, take a look here: http://caniuse.com/#feat=css-placeholder

dateInput.addEventListener('keydown', function(event) {
    if (event.keyIdentifier == "Down") {
        event.preventDefault()
    }
}, false);
input[type="date"]::-webkit-inner-spin-button{
    -webkit-appearance: none;
}

.semPicker::-webkit-calendar-picker-indicator {
    display: none;
}
<div class="caixa">
    <input type="date" /> <br/> <br/>
    <input type="date" class="semPicker" />
</div>

  • Interesting +1, it would be good to indicate in which browsers this works.

  • @Sergio Feito :)

  • Mt thanks It worked great :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.