Bug Tracker

Modify

Ticket #6193 (closed bug: wontfix)

Opened 4 years ago

Last modified 4 years ago

Reading value from multiline textarea with val is different to textarea.value

Reported by: capape Owned by:
Priority: Milestone: 1.4.3
Component: core Version: 1.4.2
Keywords: Cc:
Blocking: Blocked by:

Description

Hello,

When I try to read a textarea value with $('#id').val(), and this textarea has multiline value, $('#id').val() is giving me a different value than document.getElementBy('id').value.

The effect is that when transforming \r\n to \n, and sendind data to a server, servers receive a single line instead of several lines.

I've attached a html file. This is happening with Internet Explorer and Opera. The behaviour with firefox seems to be incorrect too.

Attachments

textarea-jquery.html Download (1.1 KB) - added by capape 4 years ago.
Load the file and press button. The data in textarea is read with diferent methods, and shown with alerts.

Change History

Changed 4 years ago by capape

Load the file and press button. The data in textarea is read with diferent methods, and shown with alerts.

comment:1 Changed 4 years ago by john

  • Status changed from new to closed
  • Resolution set to wontfix

This is an intentional change. Browsers weren't consistent about providing the \r in the retrieved value so we remove it to become consistent across all browsers.

comment:2 Changed 4 years ago by capape

This breaks line separator in multiline html elements, doesn't it?

See  http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

I openned a bug in bugzilla to firefox ( https://bugzilla.mozilla.org/show_bug.cgi?id=549278).

Thanks.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.