Bug 263880

Summary: `minlength` attribute is not always respected
Product: WebKit Reporter: Marek Pepke <pepkin88>
Component: FormsAssignee: 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
Reported 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/
Attachments
Radar WebKit Bug Importer
Comment 1 2023-11-06 03:42:16 PST
Note You need to log in before you can comment on or make changes to this bug.