Bug 263880
| Summary: | `minlength` attribute is not always respected | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Marek Pepke <pepkin88> |
| Component: | Forms | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | akeerthi, cdumez, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | https://jsfiddle.net/pepkin88/eh3voLpg/22/ | ||
Marek Pepke
The first input (a keystroke, a paste) in the textarea element doesn't check, if the length of the textarea's value is less than `minlength`.
So if a textarea field is required an has set a minlength (5, for example), it can be valid with only a one character entered.
Moreover, I found out, that if the value of a field (textarea or input) is set by JS, the `minlength` is never checked. So the following element is always valid:
<input name="asd" minlength="5" oninput="this.value = this.value">
Test page: https://jsfiddle.net/pepkin88/eh3voLpg/19/
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/117992589>