I am using readonly
, disabled
and required
property of input text field like this:
<input type="text" id="visitDate" name="visitdate" readonly="readonly" disabled="disabled" required="required" />
My problem is that two of three property i.e. disabled
and readonly
are working properly but required
is not working. Submit button allows to submit even it is empty. But if I remove readonly
form can't be submitted empty.
I use
readonly because I am using date picker and user are not allowed to input date manual.
disabled because I want this input field disable at the beginning
required because use must select date from date picker so that date will not be empty.