tomayac’s avatartomayac’s Twitter Archive—№ 16,879

    1. …in reply to @samthor
      @samthor You got me curious: interestingly regular text input fields are left as-is, whereas email input fields get trimmed: both name and email had a leading and a trailing space, this is where I ended up at: interactive-examples.mdn.mozilla.net/pages/tabbed/form.html?name=+Jane+Doe+&email=jane.doe%40example.com
  1. …in reply to @tomayac
    @samthor Which is indeed spec'ed: html.spec.whatwg.org/multipage/input.html#:~:text=address.-,The%20value%20sanitization%20algorithm%20is%20as%20follows%3A%20Strip%20newlines%20from%20the%20value%2C%20then%20strip%20leading%20and%20trailing%20ASCII%20whitespace%20from%20the%20value.,-Constraint But again, my point was for client-side validation that typically involves JavaScript. The coupon code use case remains, just trim() server- and client-side before validating (or make your pattern accept whitespace both ends).