Opened 12 years ago
Closed 12 years ago
#9404 closed bug (invalid)
$.each() returns the value with strange behavior
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | 1.next |
Component: | unfiled | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
<select class="cmbField" name="test"> <option>- Choose -</option> <option value="PTAXNO">TAX </option> <option value="PTBANK_CODE">BANK NAME</option> <option value="PTBANK_NO">ACCOUNT NUM</option> <option value="PTBANK_NO_NAME">HOLDER</option> </select> $('.cmbField').each(function(idx, val) { console.debug($(val).val()); });
--- OUTPUT (val returns textnode) ---
- Choose -
PTAXNO PTBANK_CODE PTBANK_NO PTBANK_NO_NAME
<select class="cmbField" name="test"> <option value="">- Choose -</option> <option value="PTAXNO">TAX </option> <option value="PTBANK_CODE">BANK NAME</option> <option value="PTBANK_NO">ACCOUNT NUM</option> <option value="PTBANK_NO_NAME">HOLDER</option> </select> $('.cmbField').each(function(idx, val) { console.debug($(val).val()); });
--- OUTPUT--- (IF it has empty string value with attribute-> OK)
- empty string -
PTAXNO PTBANK_CODE PTBANK_NO PTBANK_NO_NAME
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Owner: | set to [email protected]… |
---|---|
Status: | new → pending |
Thanks for taking the time to contribute to the jQuery project! Please provide a reduced jsFiddle test case to help us assess your ticket!
Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, I've created this boilerplate: http://jsfiddle.net/rwaldron/da3nM/ Open the link and click to "Fork" in the top menu.
comment:3 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
http://www.w3.org/TR/html401/interact/forms.html#h-17.6
value = cdata [CS]
This attribute specifies the initial value of the control. *If this attribute is not set, the initial value is set to the contents of the OPTION element.*
1st one
2nd one