Bug 263880 - `minlength` attribute is not always respected
Summary: `minlength` attribute is not always respected
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: https://jsfiddle.net/pepkin88/eh3voLp...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-10-30 04:41 PDT by Marek Pepke
Modified: 2023-11-06 03:42 PST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Pepke 2023-10-30 04:41:20 PDT
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/
Comment 1 Radar WebKit Bug Importer 2023-11-06 03:42:16 PST
<rdar://problem/117992589>