I am using a HTML input element with type as date,
<input
type="text"
placeholder="Date of Appointment"
id="appointment_date"
name="appointment_date"
class="input-sm form-full"
required value="<?php if(isSet($_POST["submit"])){echo $_POST['appointment_date'];}?>"
onfocusout="(this.type='text')"
onfocus="(this.type='date',this.step='0')"
>
When I use the above element it creates a default date format i.e. mm/dd/yyyy text within that input element.
How do I remove this default text?
I want to disable the dd-mm-yyyy step values so only selected date can be taken as input for above code. Please suggest a JS solution for this. I tried adding below style on my page but it is hiding the selected date value as well,
input[type=date]::-webkit-datetime-edit-text {
-webkit-appearance: none;
display: none;
}
input[type=date]::-webkit-datetime-edit-month-field{
-webkit-appearance: none;
display: none;
}
input[type=date]::-webkit-datetime-edit-day-field {
-webkit-appearance: none;
display: none;
}
input[type=date]::-webkit-datetime-edit-year-field {
-webkit-appearance: none;
display: none;
}