-
Notifications
You must be signed in to change notification settings - Fork 261
val(): Update select multiple no selected statement for 3.0. Fixes #828 #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Have you seen #939? What do you think about code example changes there? |
|
Oh, bummer! I didn't see that one. The code example change there looks fine to me. Maybe we could merge that one first. Then merge mine, keeping that code change but using my content change? |
|
Sounds good. Would you do that? Michał Gołębiowski |
|
sure. |
|
LGTM. |
entries/val.xml
Outdated
| <p><code>val()</code> allows you to pass an array of element values. This is useful when working on a jQuery object containing elements like <code><input type="checkbox"></code>, <code><input type="radio"></code>, and <code><option></code>s inside of a <code><select></code>. In this case, the <code>input</code>s and the <code>option</code>s having a <code>value</code> that matches one of the elements of the array will be checked or selected while those having a <code>value</code> that doesn't match one of the elements of the array will be unchecked or unselected, depending on the type. In the case of <code><input type="radio"></code>s that are part of a radio group and <code><select></code>s, any previously selected element will be deselected.</p> | ||
| <p>Setting values using this method (or using the native <code>value</code> property) does not cause the dispatch of the <code>change</code> event. For this reason, the relevant event handlers will not be executed. If you want to execute them, you should call <code>.trigger( "change" )</code> after setting the value.</p> | ||
| <p>The <code>.val()</code> method allows us to set the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value: </p> | ||
| <p>The <code>.val()</code> method allows settting the value by passing in a function. As of jQuery 1.4, the function is passed two arguments, the current element's index and its current value: </p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"settting" should be "setting"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch. thanks!
Added a statement about the difference between >=3.0 and <3.0 when calling .val() on <select multiple> with no options selected.