Bug 193278 - Setting <option> value to empty via JS prevents validation
Summary: Setting <option> value to empty via JS prevents validation
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari 12
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: BrowserCompat, InRadar
Depends on:
Blocks:
 
Reported: 2019-01-09 05:03 PST by martin_petrov
Modified: 2023-04-07 04:27 PDT (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 martin_petrov 2019-01-09 05:03:23 PST
Submit a form with <select required> where the current <option> value is set to empty via js. It's not validated.

https://jsfiddle.net/njw9pvo5/

<form>
  <select required>
    <option id=myoption>test</option>
  </select>
  <button>submit</button>
</form>

<script>
  myoption.value = ''
</script>
Comment 1 Radar WebKit Bug Importer 2019-01-10 14:10:56 PST
<rdar://problem/47189998>
Comment 2 Ahmad Saleem 2023-04-07 04:27:57 PDT
Safari Technology Preview 167 does not show any tooltip to reflect that the selection is manadatory while it does for Chrome Canary 114 and Firefox Nightly 113.