0

I have a date field in my html page :

<input type="date"   id="birth_date" name="birth_date" placeholder="dd/mm/yyyy"   /> 

When I launch my application I got this result :

this

I need to know How can I hide these controls ( right of the image) using the simplest way ?

Thanks,

1

2 Answers 2

3

If I understand correctly, there are 4 things you want to remove for input[type=date] on a webkit browser:

  1. Blue cross
  2. Up arrow button
  3. Down arrow button
  4. Datepicker dropdown button (opens up datepicker)

This CSS rule will hide them all:

input[type=date]::-webkit-clear-button, /* blue cross */
input[type=date]::-webkit-inner-spin-button, /* up */
input[type=date]::-webkit-outer-spin-button, /* down */
input[type=date]::-webkit-calendar-picker-indicator /* datepicker*/ {
    display: none;
}
Sign up to request clarification or add additional context in comments.

Comments

0

You can do it like this:

input::-webkit-clear-button { 
  -webkit-appearance: none;
  margin: 0;
}

JS FIDDLE DEMO

4 Comments

No change, I got no change
It should work. You can check the JSFIDDLE demo I posted now.
I got different result when I change the browser. even using your demo
Maybe you should try -moz-appearance in case you are using firefox.

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.