Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jquery
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
jquery
Commits
330867ac
Commit
330867ac
authored
Jun 02, 2006
by
Gilles van den Hoven
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some errors in the formvalues() function
parent
4a36d004
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
ajax.js
ajax/ajax.js
+16
-13
No files found.
ajax/ajax.js
View file @
330867ac
...
@@ -141,26 +141,26 @@ $.fn.load = function(a,o,f) {
...
@@ -141,26 +141,26 @@ $.fn.load = function(a,o,f) {
*/
*/
$
.
fn
.
formValues
=
function
(
sButton
)
{
$
.
fn
.
formValues
=
function
(
sButton
)
{
var
a
=
[];
var
a
=
[];
var
elp
=
{
INPUT
:
true
,
TEXTAREA
:
true
,
OPTION
:
true
};
var
ok
=
{
INPUT
:
true
,
TEXTAREA
:
true
,
OPTION
:
true
};
// Loop the shite
// Loop the shite
$
(
'*'
,
this
).
each
(
function
()
{
$
(
'*'
,
this
).
each
(
function
()
{
// Skip
disabled elements
// Skip
elements not of the types in ok
if
(
this
.
disabled
)
if
(
!
ok
[
this
.
tagName
.
toUpperCase
()]
)
return
;
return
;
// Skip
elements not of the types in elp
// Skip
disabled elements
if
(
!
elp
[
this
.
tagName
.
toUpperCase
()]
)
if
(
this
.
disabled
)
return
;
return
;
// Skip submit buttons and image elements
// Skip submit buttons and image elements
if
((
this
.
type
==
'submit'
)
||
(
this
.
type
==
'image'
))
if
((
this
.
type
==
'submit'
)
||
(
this
.
type
==
'image'
))
return
;
return
;
// Skip non-selected options
// Skip non-selected options
var
sP
=
this
.
parentNode
.
nodeName
.
toUpperCase
();
var
oParent
=
this
.
parentNode
;
if
(((
sP
==
'SELECT'
)
||
(
sP
==
'OPTGROUP'
))
&&
(
!
this
.
selected
))
var
sNn
=
oParent
.
nodeName
.
toUpperCase
();
if
(((
sNn
==
'SELECT'
)
||
(
sNn
==
'OPTGROUP'
))
&&
(
!
this
.
selected
))
return
;
return
;
// Skip non-checked nodes
// Skip non-checked nodes
...
@@ -168,13 +168,16 @@ $.fn.formValues = function(sButton) {
...
@@ -168,13 +168,16 @@ $.fn.formValues = function(sButton) {
return
;
return
;
// If we come here, everything is fine
// If we come here, everything is fine
var
sN
=
this
.
name
||
this
.
id
||
this
.
parentNode
.
name
||
this
.
parentNode
.
id
;
var
sKey
=
this
.
name
||
this
.
id
||
oParent
.
name
||
oParent
.
id
;
var
sV
=
this
.
value
;
var
sValue
=
this
.
value
;
if
((
!
sN
)
&&
(
sP
==
'OPTGROUP'
))
sN
=
this
.
parentNode
.
parentNode
.
name
||
this
.
parentNode
.
parentNode
.
id
;
// If we don't have an ID, and the parent is an OPTGROUP,
// get the NAME or ID of the OPTGROUP's parent
if
((
!
sKey
)
&&
(
sNn
==
'OPTGROUP'
)
&&
(
oParent
=
oParent
.
parentNode
))
sKey
=
oParent
.
name
||
oParent
.
id
;
// Add the data
// Add the data
a
.
push
({
name
:
s
N
,
value
:
sV
});
a
.
push
({
name
:
s
Key
,
value
:
sValue
});
});
});
// Add submit button if needed
// Add submit button if needed
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment