val(): Update select multiple no selected statement for 3.0. Fixes #828#955
Closed
kswedberg wants to merge 5 commits into
Closed
val(): Update select multiple no selected statement for 3.0. Fixes #828#955kswedberg wants to merge 5 commits into
kswedberg wants to merge 5 commits into
Conversation
Member
|
Have you seen #939? What do you think about code example changes there? |
Member
Author
|
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? |
Member
|
Sounds good. Would you do that? Michał Gołębiowski |
Member
Author
|
sure. |
Member
|
LGTM. |
| <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> |
Member
There was a problem hiding this comment.
"settting" should be "setting"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added a statement about the difference between >=3.0 and <3.0 when calling .val() on <select multiple> with no options selected.