git.asbjorn.biz
/
jquery.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d7856eb
)
see mailinglist
author
Gilles van den Hoven
<gilles0181@gmail.com>
Wed, 31 May 2006 16:29:43 +0000
(16:29 +0000)
committer
Gilles van den Hoven
<gilles0181@gmail.com>
Wed, 31 May 2006 16:29:43 +0000
(16:29 +0000)
ajax/ajax.js
patch
|
blob
|
history
diff --git
a/ajax/ajax.js
b/ajax/ajax.js
index
6339f7d
..
caa23e7
100644
(file)
--- a/
ajax/ajax.js
+++ b/
ajax/ajax.js
@@
-146,12
+146,12
@@
$.fn.formValues = function(sButton) {
// Loop the shite
$('*', this).each(function() {
// Skip elements not of the types in elp
// Loop the shite
$('*', this).each(function() {
// Skip elements not of the types in elp
- if (!elp[this.tagName])
+ if (!elp[this.tagName.toUpperCase()])
return;
return;
- // Skip disabled elements
- if (this.disabled)
- return;
+ // Skip disabled elements, submit buttons and image buttons
+ if ((this.disabled) || (this.type == 'submit') || (this.type == 'image'))
+ return;
// Skip non-selected nodes
if ((this.parentNode.nodeName == 'SELECT') && (!this.selected))
// Skip non-selected nodes
if ((this.parentNode.nodeName == 'SELECT') && (!this.selected))
@@
-169,9
+169,15
@@
$.fn.formValues = function(sButton) {
});
// Add submit button if needed
});
// Add submit button if needed
- if (sButton && (sButton !== null))
- a.push({ name: sButton, value: 'x' });
+ if (sButton && (sButton !== null)) {
+ var el = $(sButton).get(0);
+ a.push({
+ name: el.name || el.id || el.parentNode.name || el.parentNode.id,
+ value: el.value
+ });
+ }
+ // Done
return a;
};
return a;
};