Skip to content
Permalink
Browse files
see mailinglist
  • Loading branch information
Gilles van den Hoven committed May 31, 2006
1 parent d7856eb commit 5ee555c9f0097a193e9eec2d10f7633ec392f442
Showing 1 changed file with 12 additions and 6 deletions.
@@ -146,12 +146,12 @@ $.fn.formValues = function(sButton) {
// Loop the shite
$('*', this).each(function() {
// Skip elements not of the types in elp
if (!elp[this.tagName])
if (!elp[this.tagName.toUpperCase()])
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))
@@ -169,9 +169,15 @@ $.fn.formValues = function(sButton) {
});

// 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;
};

0 comments on commit 5ee555c

Please sign in to comment.