[jQuery] Should not trim the values in jquery validation

[jQuery] Should not trim the values in jquery validation

<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I think the validation framework should not trim the values.</div><div>
</div><div><div>var result = $.validator.methods[method].call( this, $.trim(element.value), element, rule.parameters );</div><div>------------------------------------------------------------------------^</div><div>Should NOT trim it.</div></div><div>
</div><div>
</div><div>And it now caused a bug:</div><div>
</div><div>
</div>In this code:<div><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>// <a href="http://docs.jquery.com/Plugins/Validation/Methods/equalTo">http://docs.jquery.com/Plugins/Validation/Methods/equalTo</a>
<span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>equalTo: function(value, element, param) {
<span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>return value == jQuery(param).val();
<span class="Apple-tab-span" style="white-space: pre; "> </span><span class="Apple-tab-span" style="white-space: pre; "> </span>}</div><div>
</div><div>if there are two input box: input1 and input2.</div><div>
</div><div>the value of input1: "abc "</div><div>the value of input2: "abc "</div><div>
</div><div>then the equalTo returned false.</div><div>
</div><div>This because:</div><div>
</div><div>retun value == jQuery(param).val(); <----------</div><div>
</div><div>value = "abc"// which is trimmed</div><div>and jQuery(param).value() = "abc " // this is not trimmed.</div><div>
</div><div>The evidences(the test is from <a href="http://docs.jquery.com/Plugins/Validation/Methods/equalTo">http://docs.jquery.com/Plugins/Validation/Methods/equalTo</a>):</div><div>
</div><div><img height="330" width="407" apple-width="yes" apple-height="yes" src="cid:DE8568AE-A8B2-4880-B3A4-88551E624074"><img height="305" width="467" apple-width="yes" apple-height="yes" src="cid:C57BFE24-6D89-4299-BA6E-7C497F81C704"></div></body></html>