Skip to main content

Bug Tracker

Side navigation

#14337 closed bug (notabug)

Opened September 05, 2013 04:17PM UTC

Closed September 05, 2013 04:45PM UTC

Last modified September 05, 2013 05:11PM UTC

Trim in val() form field method

Reported by: rapomon@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

When I try to get a value from an input type email, jquery is trimming the value!

Example:

http://rapomon.no-ip.info/jquery-bug.png

Attachments (0)
Change History (3)

Changed September 05, 2013 04:37PM UTC by rapomon@gmail.com comment:1

Changed September 05, 2013 04:45PM UTC by dmethvin comment:2

resolution: → notabug
status: newclosed

jQuery is not trimming the value, it's trimmed before we see it.

http://jsfiddle.net/BEjvq/1/

If you look at the spec, a space would NOT be valid and shouldn't be there, so I assume the browser is trimming it, although that still doesn't make the value property valid.

http://www.w3.org/TR/html-markup/input.email.html

Changed September 05, 2013 05:11PM UTC by rapomon@gmail.com comment:3

It's true, an email value don't allow spaces. Thanks.