﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
10480	jQuery val() override behaves differently than the original	Maxime Handfield Lapointe		"Summary: CKEditor's val() returns the value of the last element, while jQuery's returns the value of the first element.

Reproduce:
On a page with 2 input text, do the following:
jQuery('input[type=text]').first().val('value1')
jQuery('input[type=text]').last().val('value2')
jQuery('input[type=text]').val()

This last line will return 'value1' if on a page without CKEditor, and 'value2' on a page with CKEditor (and jqueryOverrideVal set to true).

This will happen in any browser and os. (Tested with chrome on Ubuntu)

More in depth:
The val() function of jQuery, when used to get a value, will get the value of the first element it contains only.

The val() function of CKEditor that overrides jQuery's will walk over every element contained in the jQuery object (using each) and call getData or oldValMethod on each element. Then, it will return the value of the last element.


I do not have a test case file as this can be reproduced on just about any page, as long as the jqueryOverrideVal is set to true."	Bug	closed	Normal		General	4.1.2	duplicate	HasPatch	
