0

I am validating a file upload.
I hid the file input and replaced it with a readonly input, into which I place the filename so it can be seen. I want to display validation on this input, refelected from the file input.

However, $valid is not applicable on readonly inputs, as explained here.

How do I validate while keeping the functionality of being readonly?

Community
  • 1
  • 1
Aryeh Beitz
  • 1,974
  • 1
  • 22
  • 23

1 Answers1

0

Apparently, in css I can do user-select: none; which makes the input read only, while keeping validation.

See here

Community
  • 1
  • 1
Aryeh Beitz
  • 1,974
  • 1
  • 22
  • 23
  • apparently, in chrome this css property doesn't work. I found a better solution here: http://stackoverflow.com/a/17447050/3548935 – Aryeh Beitz Mar 15 '17 at 10:38